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

Checkbox Error

Status
Not open for further replies.

giahan

Programmer
Sep 1, 2000
139
US
Hi,

I try to make a form with checkbox. This is my form.html (in quote):
"
<FORM ACTION=&quot;forms4.cfm&quot; METHOD=&quot;POST&quot;>
<P>
Would you like to be added to our mailing list?
<INPUT TYPE=&quot;checkbox&quot; NAME=&quot;MailingList&quot;>
<P>
<INPUT TYPE=&quot;submit&quot; VALUE=&quot;Process&quot;>
</FORM>
&quot;

And this is my Forms4.cfm (part in quote):
&quot;
<CFOUTPUT>
Hello,<BR>
<CFIF #FORM.MailingList# CONTAINS &quot;on&quot;>
You will be added to our mailing list.
<CFELSE>
You will not be added to our mailing list.
</CFIF>
</CFOUTPUT>&quot;

I receive error message as below when I uncheck the checkbox:
&quot;
Error Diagnostic Information
Error resolving parameter FORM.MAILINGLIST


The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.


The error occurred while evaluating the expression:


#FORM.MailingList# CONTAINS &quot;on&quot;


The error occurred while processing an element with a general identifier of (CFIF), occupying document position (9:1) to (9:39). &quot;

Thank you in advance

GH
[sig][/sig]
 
You forgot to set a value attribute to your checkbox.

<cfparam name=&quot;Mailinglist&quot; default=&quot;&quot;>

<form...>
<input type=&quot;checkbox&quot; name=&quot;MailingList&quot; value=&quot;On&quot;>
</form>

<cfif MailingList eq &quot;On&quot;>
...
</cfif> [sig]<p> <br><a href=mailto:aberman@thebiz.net>aberman@thebiz.net</a><br><a href= > </a><br>Database web programmer and developer, fueled by peach snapple and mochas.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top