Print Page | Close Window

Default DropDown Selection based on Database field

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=27925
Printed Date: 29 March 2026 at 3:12am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Default DropDown Selection based on Database field
Posted By: kennywhite
Subject: Default DropDown Selection based on Database field
Date Posted: 09 October 2009 at 8:26pm
I'm not very good with coming up with descriptive subjects... Anyhow...
 
On my website users will look up and edit database records. There is one field that has specific text added to the database depending on what the user selects from a drop-down box. The options are "Yes" (the predefined text will be added) and "No" (nothing will be added to the field).
 
Later on this record may need to be edited. Is there a way that I can have the drop down box appear on the edit page with whatever selection was used on it before? Like, if there is text in Field_X, it will default to "yes", if there is not, it will default to "no." Would a checkbox be easier?
 
I don't want the users to be able to see or edit the predefined text.
 
Thanks!



Replies:
Posted By: dpyers
Date Posted: 10 October 2009 at 9:23pm
A check box implies multiple choice. for simple yes/no edits, radio buttons would be more appropriate than a drop-down.

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: WebWiz-Bruce
Date Posted: 12 October 2009 at 11:15am
You could use code like below:-

If Field_X <> "" OR NOT Field_X = Null Then Response.Write("Yes")


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



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