Default Value in Drop Down List

Results 1 to 2 of 2

Thread: Default Value in Drop Down List

  1. #1
    Join Date
    Dec 1969

    Default Default Value in Drop Down List

    I am using a dropdown list that lists certain records from a database. When the user selects one of the records and submits it, the entry is saved into an excel spreadsheet. <BR>1. How do I have the default value selected = the value entered in excel the last time?<BR>2. Due to the criteria specified sometimes the records change and the option that was chosen last time may not be available next time. In this case I need the default value to be a blank.

  2. #2
    Join Date
    Dec 1969

    Default RE: Default Value in Drop Down List

    &#060;SELECT ...&#062;<BR>&#060;OPTION Value=1&#062; First<BR>&#060;OPTION Value=2 SELECTED&#062; Second<BR>&#060;OPTION Value=3&#062; Third<BR>...<BR><BR>You just have to write a tiny bit of VBS code as you create the list of options:<BR>&#060;% IF currentOptionValue = valueFromExcel Then Response.Write "SELECTED" %&#062;<BR><BR>Same thing for if there&#039;s no matching optionValue. VBS code.<BR><BR>Without knowing where your list of options is coming from, not much else we can tell you. If you can&#039;t figure it out, give more details next time. Maybe the code you use to create the &#060;SELECT&#062;?<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