Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Default DropDown Selection based on Database field
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Default DropDown Selection based on Database field

 Post Reply Post Reply
Author
kennywhite View Drop Down
Groupie
Groupie


Joined: 26 February 2009
Location: Indy
Status: Offline
Points: 106
Post Options Post Options   Thanks (0) Thanks(0)   Quote kennywhite Quote  Post ReplyReply Direct Link To This Post Topic: Default DropDown Selection based on Database field
    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!
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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")
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.