February 2, 2007 at 10:44 am
I need help I am trying to use a database results to fill a form, but I dont
know how to make a checkbox checked
Thanks Dave
February 2, 2007 at 11:35 am
That depends on your development environment, but 0 (zero) usually represents an unchecked state, while 1, -1, or sometimes any non-zero value represents a checked state. Some dev environments even have built-in literals for "true" and "false" that work as well, and some have checkbox properties with values of "checked" and "unchecked". You can even fake it in environments without checkboxs by printing þ (Alt-0254) and ¨ (Alt-0168). When you change the font on those to "Wingdings", you get þ and ¨, respectively. You can even use that in Reporting Services, with an iif() function based on a field, for instance.
If you tell us what you're using to build the form, someone could probably tell you what value is needed to represent a checked state.
February 2, 2007 at 11:55 am
I am using Front Page to create the form
the checkbox states
<input type="checkbox" name="C1" value="ON">
initial state is not checked but value still = on when I submit the form I check where c1="on" to see if it is checked. so do I say that c1="on" or c1=1 to get it checked?
Thanks for help
Dave
February 2, 2007 at 12:05 pm
Best way to answer that one is for you to make an html page with 2 checkbox with the 2 different values and see what works.
From what I remember of Javascript, the values true/false seemed to do the trick. I'll let you whip up the tests and report back to us once you have the results.
February 2, 2007 at 2:03 pm
It's been a while, but I do think that the back end needs a 0 or 1 in FrontPage.
February 5, 2007 at 7:56 am
just to clarify, an option or checkbox must have the CHECKED in it's definition:it's a keyword, and not the "value"
<FORM METHOD=POST ACTION="">
<INPUT TYPE="checkbox" NAME="firstcheck" value="Value to send Via GET or POST">
<INPUT TYPE="checkbox" NAME="secondcheck" value="Value to send Via GET or POST" CHECKED>
</FORM>
Lowell
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply