Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop down list !!!

    (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!!
    Last edited by xolela; 02-10-2004 at 07:41 AM.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,918
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Thank you in Advance!!


    YUCK! PUKE!

    Manners maketh the man.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:
    Code:
    <select>
       <option value='254'>Pick Me! Pick Me!</option>
       <option value='3'>No, me! me! ohhh! ohhh!</option>
    </select>
    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!"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •