0

Heres my code:

<cfparam name='form.firstName' Default=''>
<cfparam name='form.yes' Default=''>
<cfparam name='form.no' Default=''>
<cfparam name='form.clean' Default=''>
<cfparam name='form.light' Default=''>
<cfparam name='form.heavy' Default=''>
<cfparam name='form.superheavy' Default=''>

<label for="firstName">Guest Access:</label>
<input type="textbox" name="firstName" value="#form.firstName#">

<label for="allkeysaccountedfor">All keys are accounted for?:</label>
<select>
  <option value="#form.yes#" name="yes">Yes</option>
  <option value="#form.no#" name="no">No</option>
</select>

<label for="unitcondition">Unit Condition?:</label>
  <input type="radio" name="clean" value="#form.clean#"><span>Clean</span>
  <input type="radio" name="light" value="#form.light#"><span>Light</span>
  <input type="radio" name="heavy" value="#form.heavy#"><span>Heavy</span>
  <input type="radio" name="superheavy" value="#form.superheavy#"><span>SuperHeavy</span>

When I submit the form, I get an email returning what I put into the text box, but when I check yes or no or select an option for the radio button, nothing gets returned in the email. Any advice would be greatly appreciated thanks!

Jorden
  • 153
  • 1
  • 3
  • 16
  • 1
    Hard to say without seeing the email code. – Leigh Mar 15 '17 at 00:40
  • My solution at the bottom covers this: http://stackoverflow.com/questions/35299944/sending-cf-mail-from-a-static-page-to-single-recipient – James A Mohler Mar 15 '17 at 06:01
  • Possible duplicate of [Sending cf mail from a static page to single recipient](http://stackoverflow.com/questions/35299944/sending-cf-mail-from-a-static-page-to-single-recipient) – James A Mohler Mar 15 '17 at 06:02
  • Your two checkboxes should have the same name as each other, as should your radio buttons. – Dan Bracuk Mar 15 '17 at 09:42

1 Answers1

0

You're setting name attributes in your options for the select and radio buttons. I would instead try setting it to the parent element like this:

<cfparam name='form.firstName' default=''>
<cfparam name='form.allkeysaccountedfor' default=''>
<cfparam name='form.unitcondition' default=''>

<label for="firstName">Guest Access:</label>
<input type="textbox" id="firstName" name="firstName" value="#form.firstName#">

<label for="allkeysaccountedfor">All keys are accounted for?:</label>
<select name="allkeysaccountedfor" id="allkeysaccountedfor">
    <option value="yes" <cfif allkeysaccountedfor eq "yes">selected</cfif>>Yes</option>
    <option value="no" [[do the same for no here]] >No</option>
</select>

<label for="unitcondition" id="unitcondition">Unit Condition?:</label>
<input type="radio" name="unitcondition" value="clean" <cfif unitcondition eq "clean">checked</cfif>><span>Clean</span>
<input type="radio" name="unitcondition" value="light" [[do the same for this value]] ><span>Light</span>
<input type="radio" name="unitcondition" value="heavy" [[do the same for this value]] ><span>Heavy</span>
<input type="radio" name="unitcondition" value="superheavy" [[do the same for this value]] ><span>SuperHeavy</span>

Then, in your email, I would look for the 3 form variables above. Also note that I added "id's" to your HTML elements. That's because the "for" attribute in the label specifies which form element a label is bound to and uses the "id" attribute to do that.

ultimoTG
  • 853
  • 6
  • 9