Not sending checkbox values in emails.

rgjoyce 01 Apr, 2010
Below is listed three sections of code.
First the Form being used
Second the HTML verison of the email template
Third the resulting email.
I can't for the life of me see where the problem is.
Version used: 3.1 RC5.5

Form being used:

<div class="cf_item"> <h3 class="cf_text">Submit to the CAN Professional Directory</h3> </div>

<div class="cf_item"> <span class="cf_text">Please fill out the form below and click "Submit." Your listing 

will appear in the CAN Professional Directory within three business days. It will also appear in the print edition each 

summer, provided your membership has not lapsed by June 1.</span> </div>

<div class="cf_text"> <span class="cf_text">Please note: You must be a CAN member to be listed in 

the CAN Professional Directory. Join the CAN Professional Directory now.</span> </div>

<div class="cf_item"> 
  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Business or Consultant Name:</span>
  <div class="cf_fields">
    <input name="text_3" type="text" value="" title="Name is required" class="cf_inputtext cf_inputbox required validate-alphanum" maxlength="150" size="30" id="text_3" />
  </div>
</div>

<div class="cf_item">
  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Description of Products/Services (1,000 characters maximum):</span>
  <div class="cf_fields">
    <textarea name="text_13" cols="30" title="" rows="3" id="text_13" class="cf_textarea cf_inputbox required"></textarea>
  </div>
</div>


<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Contact First Name</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_5" 

name="text_5" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Contact Last Name</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_7" 

name="text_7" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Address</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_11" 

name="text_11" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   City</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_9" 

name="text_9" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   State/Province</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_10" 

name="text_10" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Zip Code</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_8" 

name="text_8" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Phone</span>
  <div class="cf_fields">
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_6" name="text_6" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   E-mail</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-email" maxlength="150" size="30" title="" id="text_15" 

name="text_15" type="text" />
  
  </div>
</div>



<div class="cf_item">  <span class="cf_title" style="width: 180px;"><img width="10" height="16" border="0" align="middle" src="/images/RedStar.gif" alt="Required" style="vertical-align: middle;">   Website</span>
  <div class="cf_fields">
    <input class="cf_inputbox required validate-url" maxlength="150" size="30" title="" id="text_16" 

name="text_16" type="text" />
  
  </div>
</div>


  <div class="cf_radioLabel cf_block">
    <span class="cf_title" style="width: 180px;">Please select up to three business categories where your listing will be published.</span>
    <div class="float_left">

<input value="Accounting" title="" class="radio" id="check00" name="check0[]" type="checkbox" />
      <label for="check00" class="check_label">Accounting</label>
      <br />
      
<input value="Banking" title="" class="radio" id="check01" name="check0[]" type="checkbox" />
      <label for="check01" class="check_label">Banking</label>
      <br />
      
<input value="Benefits" title="" class="radio" id="check02" name="check0[]" type="checkbox" />
      <label for="check02" class="check_label">Benefits</label>
      <br />
      
<input value="Community Foundations" title="" class="radio" id="check0[]" name="check03" type="checkbox" />
      <label for="check03" class="check_label">Community Foundations</label>
      <br />
      
<input value="Education" title="" class="radio" id="check04" name="check0[]" type="checkbox" />
      <label for="check04" class="check_label">Education</label>
      <br />
      
<input value="Finance" title="" class="radio" id="check05" name="check0[]" type="checkbox" />
      <label for="check05" class="check_label">Finance</label>
      <br />
      
<input value="Fiscal Sponsors" title="" class="radio" id="check06" name="check0[]" type="checkbox" />
      <label for="check06" class="check_label">Fiscal Sponsors</label>
      <br />
      
<input value="Fundraising" title="" class="radio" id="check07" name="check0[]" type="checkbox" />
      <label for="check07" class="check_label">Fundraising</label>
      <br />
      
<input value="Grant/Research Centers" title="" class="radio" id="check08" name="check0[]" type="checkbox" />
      <label for="check08" class="check_label">Grant/Research Centers</label>
      <br />
      
<input value="Human Resources" title="" class="radio" id="check09" name="check0[]" type="checkbox" />
      <label for="check09" class="check_label">Human Resources</label>
      <br />
      
<input value="Incorporation and Compliance" title="" class="radio" id="check010" name="check0[]" type="checkbox" />
      <label for="check010" class="check_label">Incorporation and Compliance</label>
      <br />
      
<input value="Insurance" title="" class="radio" id="check011" name="check0[]" type="checkbox" />
      <label for="check011" class="check_label">Insurance</label>
      <br />
      
<input value="Investing" title="" class="radio" id="check012" name="check0[]" type="checkbox" />
      <label for="check012" class="check_label">Investing</label>
      <br />
      
<input value="Legal Services" title="" class="radio" id="check013" name="check0[]" type="checkbox" />
      <label for="check013" class="check_label">Legal Services</label>
      <br />
      
<input value="Management Support Organizations" title="" class="radio" id="check014" name="check0[]" type="checkbox" />
      <label for="check014" class="check_label">Management Support Organizations</label>
      <br />
      
<input value="Management/Governance Training" title="" class="radio" id="check015" name="check0[]" type="checkbox" />
      <label for="check015" class="check_label">Management/Governance Training</label>
      <br />
      
<input value="Marketing/Communications" title="" class="radio" id="check016" name="check0[]" type="checkbox" />
      <label for="check016" class="check_label">Marketing/Communications</label>
      <br />
      
<input value="Printing and Copying" title="" class="radio" id="check017" name="check0[]" type="checkbox" />
      <label for="check017" class="check_label">Printing and Copying</label>
      <br />
      
<input value="Public Policy/Advocacy" title="" class="radio" id="check018" name="check0[]" type="checkbox" />
      <label for="check018" class="check_label">Public Policy/Advocacy</label>
      <br />
      
<input value="Risk Management" title="" class="radio" id="check019" name="check0[]" type="checkbox" />
      <label for="check019" class="check_label">Risk Management</label>
      <br />
      
<input value="Studies, Research and Reports" title="" class="radio" id="check020" name="check0[]" type="checkbox" />
      <label for="check020" class="check_label">Studies, Research and Reports</label>
      <br />
      
<input value="Software" title="" class="radio" id="check021" name="check0[]" type="checkbox" />
      <label for="check021" class="check_label">Software</label>
      <br />
      
<input value="Sub-sector Organizations" title="" class="radio" id="check022" name="check0[]" type="checkbox" />
      <label for="check022" class="check_label">Sub-sector Organizations</label>
      <br />
      
<input value="Supplies" title="" class="radio" id="check023" name="check0[]" type="checkbox" />
      <label for="check023" class="check_label">Supplies</label>
      <br />
      
<input value="Technology" title="" class="radio" id="check024" name="check0[]" type="checkbox" />
      <label for="check024" class="check_label">Technology</label>
      <br />
      
<input value="Telecommunications" title="" class="radio" id="check025" name="check0[]" type="checkbox" />
      <label for="check025" class="check_label">Telecommunications</label>
      <br />
      
<input value="United Ways" title="" class="radio" id="check026" name="check0[]" type="checkbox" />
      <label for="check026" class="check_label">United Ways</label>
      <br />
      
<input value="Volunteer Centers" title="" class="radio" id="check027" name="check0[]" type="checkbox" />
      <label for="check027" class="check_label">Volunteer Centers</label>
      <br />
      
<input value="Other" title="" class="radio" id="check028" name="check0[]" type="checkbox" />
      <label for="check028" class="check_label">Other</label>
      <br />
      

    </div>
</div>
</div>


  <div class="cf_button">
    <input value="Submit" name="button_18" type="submit" /><input type="reset" name="reset" value="Reset"/>
  </div>
</div>


Email template code:

<div class="cf_item">
<h3 class="cf_text">Submit a CAN Classifieds Listing</h3>
</div>
<div class="cf_item"><span class="cf_text">Please fill out the form below and click "Submit." Your listing will appear in the CAN Classifieds within three business days. It will also appear in the print edition each summer, provided your membership has not lapsed by June 1.</span></div>
<div class="cf_item"><span class="cf_text">Please note: You must be a CAN member to be listed in the CAN Classifieds. Join CAN now.</span></div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Business or Consultant Name</h3>
<div class="cf_fields">{text_3} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Description of Products/Services (1,000 characters maximum)</h3>
<div class="cf_fields">{text_13} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Contact First Name</h3>
<div class="cf_fields">{text_5} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Contact Last Name</h3>
<div class="cf_fields">{text_7} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Address</h3>
<div class="cf_fields">{text_11} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">City</h3>
<div class="cf_fields">{text_9} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">State/Province</h3>
<div class="cf_fields">{text_10} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Zip Code</h3>
<div class="cf_fields">{text_8} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Phone</h3>
<div class="cf_fields">{text_6} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">E-mail</h3>
<div class="cf_fields">{text_15} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Website</h3>
<div class="cf_fields">{text_16} <br /><label class="cf_botLabel"></label></div>
</div>
<div class="cf_item">
<h3 class="cf_title" style="width: 150px;">Please select up to three business categories where your listing will be published.</h3>
<label class="cf_botLabel"></label>{check0} <br /></div>


Resulting content of email:

Submit a CAN Classifieds Listing

Please fill out the form below and click "Submit." Your listing will appear in the CAN Classifieds within three business days. It will also appear in the print edition each summer, provided your membership has not lapsed by June 1.
Please note: You must be a CAN member to be listed in the CAN Classifieds. Join CAN now.

Business or Consultant Name

lkjkl 


Description of Products/Services (1,000 characters maximum)

lkjlk 


Contact First Name

jl 


Contact Last Name

kj 


Address

lkj 


City

lk 


State/Province

jlk 


Zip Code

j 


Phone

lkj 


E-mail

kjlkj@wss.cc 


Website

http://www.cc.cc 


Please select up to three business categories where your listing will be published.

{check0} 

GreyHead 01 Apr, 2010
Hi rgjoyce,

Looking at the code I think it should work OK. Have you got "ChronoForms handle my posted arrays" set to 'Yes' in the Form General tab?

Bob
rgjoyce 30 Jun, 2010
ok I've found the problem.
it's a cross browser issue.
in Firefox it works fine.
in IE 7 and 8 it sends {check0}

Haven't found how to fix it though.
GreyHead 01 Jul, 2010
Hi rgjoyce,

You may see {check0} if none of the checkboxes are checked. You can correct this in the OnSubmit Before box. The code has been posted here a couple of times.

Bob

PS I think that there is a mistake in the third checkbox: the id & name values are reversed.
GreyHead 01 Jul, 2010
Hi rgjoyce,

I can't actually see the form results to tell exactly what is happening, debug would need to be on for that.

It looks as though there are some problems with the form html. In the FireBug interpreted HTML the submit button comes after the </form> tag - I suspect that there is an unclosed <div> somewhere. You probably also need a CSS 'clear' after the floated bock of checkboxes.

Bob

PS I suspect that you may be over-validating some fields.
rgjoyce 01 Jul, 2010
Interestingly enough, If we disable the mootools script on the page, then it works propperly.
rgjoyce 01 Jul, 2010
Seems there is a problem with gantry type templates from RT
GreyHead 01 Jul, 2010
Hi rgjoyce,

Try disabling "Enable Input Styling" in the template setup. That should turn off the RokCandy for form inputs.

It looks as though the news-slider may be using JQuery and that might cause a JavaScript problem.

Bob
rgjoyce 01 Jul, 2010
Bingo.... you da man.
nml375 01 Jul, 2010
Hi all,
Good you got it sorted in the end.
Just to provide some enlightment on the issue;
The Form Styling in RT/Gantry has a nasty side-effect on IExx - not sure whether to attribute this to IE or Gantry. Nevertheless, the Form Styling essentially alters the CSS of the checkboxes so that they're not rendered on the page, and instead displays an empty label with a background image of the styled "checkbox". Upon clicking the label, the checkbox should be triggered accordingly, but in IE, this does not happen for non-rendered elements.

So, this is not a javascript error, though javascripts are involved, but an issue with IE not acting on non-rendered elements. I believe I posted about this quite some time ago, possibly along with a workaround (think it was by offsetting the checkbutton rather than hiding it - messy though, since RT's javascripts are obfuscated).

/Fredrik
This topic is locked and no more replies can be posted.