tables. Getting multiple field values

$form:tables.field_name

If a form field has at least one value, such a construction returns a table (object of class
table) with single column field, containing all field values. It is used for getting multiple field values.

Important notice: before performing operations with a table, you should first check if it exists.

Example
Choose what you like doing in your free time:
<form method="POST">
   <p><input type=checkbox name=hobby value="wsurf">windsurfing</p>
   <p><input type=checkbox name=hobby value="tv">watching TV</p>
   <p><input type=checkbox name=hobby value="books">reading books</p>
   <p><input type=submit value="OK"></p>
</form>
$hobby[$form:tables.hobby]
^if($hobby){
    Your hobbies are:<br />
    ^hobby
.menu{
        $hobby.field
    }[
<br />]
}{
    None selected}

The example will output either selected variants or a message informing that nothing has been selected.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 21.09.2007