Jump to content

Select box


kmk
 Share

Recommended Posts

A select field's html....

 <select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select> 

'Key' = what is selected and saved (i.e. the 'value' element of the options).

'Value' = what is displayed in the select (i.e. Volvo....Saab....Mercedes

 

Link to comment
Share on other sites

The key can really be anything you want. It won't be displayed (unless you modify the template), but will be what is stored in the database. For that reason, I usually use keys that are fairly close to what is displayed (if not identical) so when I browse the database directly I can easily identify the values, but this probably isn't too relevant to you. In short, you can put whatever you want as the key, unless you plan to do something specific with that value.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...