Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2003, 08:15 AM
Authorized User
 
Join Date: Sep 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Radio/checkbox problem

I am completely new to ASP but I am trying to build a DB that has update/delete/add forms. It is just about ready, but I got stuck at queries. In order to build a query I need one of the values entered as radio button or checkbox. One of the value would be "Sales Tools" the other would leave the field empty in the "YN_Sales_Tools" coloumn.

I need to leave it empty to avoid empty urls, and to cloak long URLs that are built as:
<a href="<%=rs("Sales_Tools")%>" target="_blank"><%=rs("YN_Sales_Tools")%></a></td>
The field "Sales_Tools" won't always contain a url, only if the radio button/checkbox passes the value "Sales Tools"

However, I can't seem to be able to pass a value into the DB at all. Can you please help me with some sample code both for the form as well as action code?
Thank you,
M
 
Old September 20th, 2003, 02:59 PM
Authorized User
 
Join Date: Sep 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

post all the code form that page.

 
Old September 21st, 2003, 05:49 PM
Authorized User
 
Join Date: Jun 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vinyl-junkie
Default

Radio buttons have either a yes/no or on/off value, so depending on how you have your radio button setup, your SQL statement will be of the format:

SalesTools = on

or

SalesTools = yes

Hope this helps. :)

Pat Wong
http://www.napathon.net/ - Music Around The World
For collecting tips, trade and want lists, album reviews and more.
 
Old September 23rd, 2003, 04:05 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

If the checkbox is called "SalesTools" on the first page (form), you may need to request it on the second page (processing page). Also, I'm not sure what your db is. If it is MsSql then you can use a DataType of "bit", where a value of 1 = true and 0 = false. In your second page try this...

<%
SalesTools = request("SalesTools")
if SalesTools = "" then SalesTools = null
%>






Similar Threads
Thread Thread Starter Forum Replies Last Post
checkbox or radio button value cant keep during re kumiko Classic ASP Basics 2 January 24th, 2008 09:23 PM
Radio button problem rkid VBScript 1 May 21st, 2007 02:08 PM
Radio button problem rkid BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 April 24th, 2007 12:42 AM
Enable Radio when check on Checkbox... rupen Javascript How-To 2 June 28th, 2006 04:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.