dynamic radio button issues.
Hello;
I changed around the way I do a contact form from one page loading onto another to just one page. I had my radio buttons working the 2 page way, but now, it throws an error and says that the TYPE is undefined in the form. The type is the name of my group of radio buttons. Here is what I'm doing, can someone help me fix this so a form will remember if it has to be reloaded what radio button you chose?
My code:
<cfform action="#cgi.script_name#" method="post">
<cfif form.type EQ 'male'>
<input name="type" type="radio" onClick="setVisibility('sub3', 'inline');setVisibility('sub4','none');setVisibility('sub5','none');" value='male' checked="checked"/>
<cfelse>
<input name="type" type="radio" onClick="setVisibility('sub3', 'inline');setVisibility('sub4','none');setVisibility('sub5','none');" value='male'/>
</cfif>
<cfif form.type EQ 'female'>
<input type="radio" name="type" value='female' onClick="setVisibility('sub3', 'none');setVisibility('sub4','inline');setVisibility('sub5', 'none');" checked="checked"/>
<cfelse>
<input type="radio" name="type" value='female' onClick="setVisibility('sub3', 'none');setVisibility('sub4','inline');setVisibility('sub5', 'none');"/>
</cfif>
<cfif form.type EQ 'child'>
<input type="radio" name="type" value='child' onClick="setVisibility('sub3', 'none');setVisibility('sub4','none');setVisibility('sub5', 'inline');" checked="checked"/>
<cfelse>
<input type="radio" name="type" value='child' onClick="setVisibility('sub3', 'none');setVisibility('sub4','none');setVisibility('sub5', 'inline');"/>
</cfif>
those are the 3, I need this form to remember your choice, they control parts of the form. The if statement is throwing the error, this is the error:
Element TYPE is undefined in FORM.
The error occurred in C:\quoteReq.cfm: line 282
Called from C:\Websites\187914kg3\quoteReq.cfm: line 276
Called from C:\Websites\187914kg3\quoteReq.cfm: line 275
Called from C:\Websites\187914kg3\quoteReq.cfm: line 260
Called from C:\Websites\187914kg3\quoteReq.cfm: line 1
280 : <span class="contactText">Select the type of project to get a quote.</span><br>
281 : <br>
282 : <input name="type" type="radio" id="type" onClick="setVisibility('sub3', 'inline');setVisibility('sub4','none');setVisibility('sub5','none');" value='male' <cfif form.type EQ 'male'>checked="checked"</cfif>/>
283 : <span class="contactText">Magnets</span>
284 : <input type="radio" name="type" id="type" value='female' onClick="setVisibility('sub3', 'none');setVisibility('sub4','inline');setVisibility('sub5', 'none');" <cfif form.type EQ 'female'>checked="checked"</cfif>/> Can anyone help me fix this please?
