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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve checkbox value for database

Status
Not open for further replies.

robman22

Programmer
Nov 28, 2000
12
CA
When I submit my form, if the checkbox is checked, it shows as checked in the database, but when I retrieve my data, the checkbox on my for does not display as checked.

Any help?
 
Unfortunately, the checkbox parameter is not passed when it is not checked...

The best way to deal with this is on your form:
Code:
<input type=&quot;checkbox&quot; name=&quot;checkme&quot; value=1>
Then on your action page:
Code:
<cfparam name=&quot;checkme&quot; default=0>
<cfif checkme is 1>
  Checkbox was checked.
<cfelse>
  Checkbox was not checked.
</cfif>
Hope this helps... DarkMan
 
i was using :

<input type=&quot;checkbox&quot; name=&quot;checkme&quot; value=1>

and in the action page
<cfif isdefined(&quot;checkme&quot;)>
checkbox was checked
<cfelse>
checkbox wasn't checked
</cfif>

just the same actually, i only don't create a variable if there's not

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top