refresh combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colesslow
    New Member
    • Dec 2007
    • 8

    refresh combo box

    hi~~

    i have a page that will display data from a dbase.but i don't understand why i have to refresh the page to get the value of my combo box.other fields are ok..


    <td>
    <select class="textFiel d" name="highQual" >
    <option value="<%=recor dset("Qualifica tionID")%>"sele cted></option>
    <option></option>
    </select>
    </td>
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    Originally posted by colesslow
    hi~~

    i have a page that will display data from a dbase.but i don't understand why i have to refresh the page to get the value of my combo box.other fields are ok..


    <td>
    <select class="textFiel d" name="highQual" >
    <option value="<%=recor dset("Qualifica tionID")%>"sele cted></option>
    <option></option>
    </select>
    </td>
    Not sure exactly whats happening on your page. More code would help.
    However offhand I am seeing you are setting the value of the option equal to your dbase value, but you don't have an actual text option set up to show up

    so:
    Code:
    <td>
    <select class="textField" name="highQual" >
    <option value="<%=recordset("QualificationID")%>" selected><%=recordset("QualificationID")%></option>
    <option></option>
    </select>
    </td>
    Also another thought (but again since I cant see all your code I dont know) is that you are doing a look up of some kind with that QualificationID ? If that is the case you would have to loop through all values normally populated in the drop down until you came across one that was equal to your dbase value.

    like this:
    Code:
    for x=0 to dropdownrecordset.recordcount
         if dropdownrecordset("QualificationID") = recordset("QualificationID") then
               <option value="<%=recordset("QualificationID")%>" selected><%   =recordset("QualificationID")%></option> 
         else
              'continue to populate drop down values (without selected property)
         end if   
    next

    Comment

    • colesslow
      New Member
      • Dec 2007
      • 8

      #3
      hi~~thanks..huh u...such a silly mistake..it's bcoz i just put the value without the text option..

      should be more careful next time~

      Comment

      Working...