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 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    Mumbai,India
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.forms[0]['csize1'][3-1].selected=true

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    It's better to do it on the server-side whatever it is you're using.


  •  

    Posting Permissions

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