...

View Full Version : Combo Box : Display name/text other than default on form load



vikaspa
06-19-2004, 04:26 AM
Dear All


I am accepting certain values from cmbo vox and writing the records.

Typically the combo box has value and text and I am storing value that the text displayed in combo box.

At the time of modification, I will be getting the value and I need to show the name / text in combo box accordingly

Example
<select name="csize1" class="text-b12">
<option value="1" class="text-b12">AAAA</option>
<option value="2" class="text-b12">BBBB</option>
<option value="3" class="text-b12">CCCC</option>
<option value="4" class="text-b12">DDDD</option>
<option value="5" class="text-b12">EEEE</option>
<option value="6" class="text-b12">FFFF</option>
</select>
If user selects 'CCCC', iI will be storing 3 during 'Addition of record' (or while adding the entry)

During modification I want to show the 'CCCC' in the combobox instead of 'AAAA' (om the basis of value stored)

Kindly guide me how to do this

Thanking you in advance
Vikas

Willy Duitt
06-19-2004, 06:31 AM
document.forms[0]['csize1'][3-1].selected=true :confused:

glenngv
06-21-2004, 12:15 PM
It's better to do it on the server-side whatever it is you're using.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum