Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proper way to insert blank "check box" value(s)

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
I don't know why my check-box value is not being inserted when left blank. Thanks in advance.


Check box value = In Blue
SQL9="INSERT INTO table (field1,field2,hot,field4,field5,field6) Values ("&_
""& request.form("field1")& ", " &_
"'"& request.form("field2")& "', " &_
""& request.form("hot")& ", " &_
"'"& request.form("field4")& "', " &_
"#"& field5 & "#, " &_
""& request.form("field6")& ") "

QUOTE OF THE DAY
"The most important ingredient in the formula of success is knowing how to get along with people"
<%
Jr Clown
%>
 
Check the table and make sure that it will accept empty or null fields. What kind of db is it?
Mark
 
It's a Yes\No field and is required. Access QUOTE OF THE DAY
&quot;The most important ingredient in the formula of success is knowing how to get along with people&quot;
<%
Jr Clown
%>
 
I found the problem. thanks for your help. QUOTE OF THE DAY
&quot;The most important ingredient in the formula of success is knowing how to get along with people&quot;
<%
Jr Clown
%>
 
Then I would set a default response in the table as no. You can then have them check yes to change the default.

Mark
 
But perhaps you can help me on this other question:
when the user clicks on the box and the value of my checkbox displays on my page, how do I replace the value with a .jpg.
Something like
<%
if checkbox.value = &quot;value&quot; then
<img src=&quot;image.jpg&quot;
end if
%>

This is not working tho. QUOTE OF THE DAY
&quot;The most important ingredient in the formula of success is knowing how to get along with people&quot;
<%
Jr Clown
%>
 
Are you rebuilding the page and doing something like sending a confirmation page?

Mark
 
I'm simply trying to display an image when the check box is selected. Instead of displaying the value of the checkbox. Do you know how to do this?? QUOTE OF THE DAY
&quot;The most important ingredient in the formula of success is knowing how to get along with people&quot;
<%
Jr Clown
%>
 
That would have to be done client side. You should ask someone who knows java script if that is possible. The only way it could be done in asp would be having the page rebuilt server side.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top