View Full Version : Please help me out!!!

02-10-2004, 08:06 AM
(I'm using javascript) just wanna know if is it possible when you are reading data from database to your Dropdown list, to read in both your item description and its key field. Because when I select an item from my dropdown list, I wanna retrieve all other items that are related to the selected item using that key field. Now I don't know how to attach a key field to the drop down list.

I know how to do this in VB using a DATA COMBO!!

Please somebody help.

Thank you in Advance!!

02-10-2004, 08:29 AM
Point #2 - http://www.codingforums.com/postguide.htm

Philip M
02-10-2004, 08:47 AM
Thank you in Advance!!


Manners maketh the man.

02-10-2004, 05:40 PM
Ignoring the posting fau pax for the moment...

The easist way is to carry the key in the 'value' attribute of the individual <option> tags. Thus it might look like this:

<option value='254'>Pick Me! Pick Me!</option>
<option value='3'>No, me! me! ohhh! ohhh!</option>

Your users see "Pick Me! Pick Me!" but what's really being selected is the unseen corresponding value. When one SUBMITs the <form> it's the value of 'value' that's picked up... so "254" is sent, not "Pick Me! Pick Me!"