Print Page | Close Window

Updating a forms drop down menu

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3881
Printed Date: 30 March 2026 at 1:37am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Updating a forms drop down menu
Posted By: edulog
Subject: Updating a forms drop down menu
Date Posted: 27 June 2003 at 1:34pm
I've created a basic access database, using asp pages to read record and write new records.

I'm on working on updating exsiting records in the database. The user can add a new record to the database using a complicated HTML form. In this form I have some drop down menus, where the user can pick diffierent choises to enter.

For updating an exsiting record I want to use the same form. But, I don't know how to get the drop down menu to show the correct entry in the record. Here is an example of my code...

<tr><td>WebQuery Purchased:</td><td>
         <SELECT name="WebQuery">
             <OPTION><% Response.Write (rsGuestbook("WebQuery")) %></OPTION>
             <OPTION selected value="true">True</OPTION>
             <OPTION selected value="false">False</OPTION>
         </SELECT></td></tr>

Thanks!!



Replies:
Posted By: Scotty32
Date Posted: 27 June 2003 at 1:44pm

you could try

<SELECT name="WebQuery">
     <OPTION value="true" <% if rsGuestbook("WebQuery") = true then Response.Write("SELECTED")%>>True</OPTION>
     <OPTION value="false"<% if rsGuestbook("WebQuery") = false then Response.Write("SELECTED")%>>False</OPTION>
</SELECT>

if this doesnt work try using quotes round the true and false.. if you get any errors post the error here so sumone else or i can help futher

also you might want to thing about using a differnet page to edit records, as you cant get a record if your trying to posting one




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net