Subject: Radio/checkbox problem
Posted By: mariakovacs Post Date: 9/12/2003 8:15:06 AM
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></font></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
Reply By: mtuppers Reply Date: 9/20/2003 2:59:13 PM
post all the code form that page.

Reply By: vinyl-junkie Reply Date: 9/21/2003 5:49:07 PM
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.
Reply By: DaveGerard Reply Date: 9/23/2003 4:05:02 PM
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
%>


Go to topic 4268

Return to index page 1040
Return to index page 1039
Return to index page 1038
Return to index page 1037
Return to index page 1036
Return to index page 1035
Return to index page 1034
Return to index page 1033
Return to index page 1032
Return to index page 1031