set_select($field[, $value = ''[, $default = FALSE]])
Parameters: |
|
---|---|
Returns: |
‘selected’ attribute or an empty string |
Return type: |
string |
If you use a <select> menu, this function permits you to display the menu item that was selected.
The first parameter must contain the name of the select menu, the second parameter must contain the value of each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).
Example:
<select name="myselect"> <option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option> <option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option> <option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option> </select>
Please login to continue.