Jump to content

Select box


Recommended Posts

A select field's html....

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

'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


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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