Skip to Content Skip to Menu

Can dropdown field option value be different than what is displayed between option tags?

  • bogies
  • bogies
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
11 years 8 months ago #219473 by bogies
Hi
I hope this is the proper category for this question.
Is there a way to have the option value be different than what is displayed between the option tags in a dropdown.

Example:
This is the way cb creates the dropdown field, the value and what is between the option tags is the same. There is no option when editing the field to put something different between the option tags.

<select id="cb_dateformat" class="required inputbox" name="cb_dateformat">
<option id="cbf22" selected="selected" value="U.S.">U.S.</option>
<option id="cbf23" value="International">International</option>
</select>

Would like it to be like this:
When the form is viewed the user will see the 2 options in the dropdown U.S. and International but the option value would be 1 and 2 instead of being the same as what is displayed between the option tags.

<option id="cbf22" selected="selected" value="1">U.S.</option>
<option id="cbf23" value="2">International</option>

Can anyone comment if there is a way to do this?
Or is it just not possible because of the way the field values work?

Thanks very much

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum