Initialise Drop Down List

Results 1 to 3 of 3

Thread: Initialise Drop Down List

  1. #1
    anne marie Guest

    Default Initialise Drop Down List

    I have a drop down list on my ASP page, and the user selects an option which is then stored in their profile. Is there any way that I can set the initial value of the drop down list to their stored profile value, the next time they view their profile.<BR><BR>Could this be done with Combo Boxes?

  2. #2
    Culture Guest

    Default RE: Initialise Drop Down List

    Use cookies.<BR><BR>You have to (on the next page) set the cookie<BR>Sooo<BR><BR>Response.cookies("TheCollect ionOnThisSubject")("DropDownDefaultValue") = request.form("DropDown")<BR><BR>Then on load of the form you do:<BR><BR>if request.cookies("TheCollectionOnThisSubject")("Dro pDownDefaultValue") &#060;&#062; "" then<BR>valuetodefault = request.cookies("TheCollectionOnThisSubject")("Dro pDownDefaultValue") <BR>end if<BR>%&#062;<BR>then loop through your options (i assume you build them using a database - if not do a "for each", and check each value against the valuetodefault - if the values equal then write:<BR>&#060;option selected&#062;<BR>else<BR>&#060;option&#062;<BR><B R><BR>hope that helps....<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Initialise Drop Down List

    You could also match both recordsets together. rs1 being a recordset of all your option tags for the drop-down, and rs2 being that persons profile information:<BR><BR>Do Until rs1.EOF<BR> If CInt(rs2("item")) = CInt(rs1("item")) Then<BR> Response.Write "OPTION SELECTED VALUE="someValue"&#062;.....<BR> Else<BR> Response.Write "OPTION VALUE="someValue"&#062;.....<BR> End If<BR> rs1.MoveNext<BR>Loop<BR><BR>Hope this helps<BR><BR>

Posting Permissions

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