I开发者_如何学编程 am looking for a JQUERY list box (or select box) with value as MON,TUE,WED,THUR,FRI,SAT,SUN and text as Monday,Tuesday,Wednesday,Friday,Saturday,Sunday. The text will be displayed to the user. If the user selects Friday from the list box the corresponding value FRI is passed to the server. While loading the list box if the value from the server is FRI than Friday must be automatically selected. Can anyone share the JQUERY code which can do this. I appreciate it.
Note: I have the code to get the server value.
Not sure why you need jQuery code to do this, this is a simple select box:
<select name="weekdays">
<option value="SUN">Sunday</option>
<option value="MON">Monday</option>
<option value="TUE">Tuesday</option>
<option value="WED">Wednesday</option>
<option value="THUR">Thursday</option>
<option value="FRI">Friday</option>
<option value="SAT">Saturday</option>
</select>
By default, when the form is submitted, the value attribute is sent to the server, wheras the text is not.
精彩评论