I wonder if anyone can help with this; I have set up a contact form with checkbox options. Anyone know how to get checkbox values in the email response?.
Here is the code;
[+validationmessage+]
<form method="post" action="[~[*id*]~]">
<input type="hidden" name="formid" value="eContactForm" />
<p><label accesskey="n" for="Name">Full Name: </label>
<input type="text" name="Name" maxlength="60" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></p>
<p><label for="Address" >Address: </label>
<input type="text" name="address" size="40" maxlength="100" eform="Your Address:address:1" /></p>
<p><label for="Town" >City/Town: </label>
<input type="text" name="town" size="40" maxlength="40" eform="Your Town:town:1" /></p>
<p><label for="County" >County: </label>
<input type="text" name="county" size="40" maxlength="40" eform="Your County:county:1" /></p>
<p><label for="postcode">Postcode: </label>
<input type="text" name="postcode" size="40" maxlength="40" eform="Postcode:postcode:1" /></p>
<p><label accesskey="e" for="email">Email: </label>
<input type="text" name="email" size="40" maxlength="40" eform="Your Email Address:email:1" /></p>
<p><label accesskey="t" for="tel">Telephone Number: </label>
<input type="text" name="tel" size="40" maxlength="40" eform="Your Telephone Number:tel:1" /></p>
<h1>Interested In:</h1>
<table id="interest">
<tr>
<td width="30%">Windows</td>
<td width="15%"><input name="interest[" type="checkbox" eform="Your interest:Interest-windows" value="Windows" /></td>
<td width="48%">Steel</td>
<td width="7%"><input name="material[" type="checkbox" eform="Your interest:Interest-steel" value="Steel" /></td>
</tr>
<tr>
<td>Conservatories</td>
<td><input name="interest[]" type="checkbox" value="Conservatories" /></td>
<td>Aluminium</td>
<td><input name="material[]" type="checkbox" value="Aluminium" /></td>
</tr>
<tr>
<td>Fascias</td>
<td><input name="interest[]" type="checkbox" value="Fascias" /></td>
<td>Timber</td>
<td><input name="material[]" type="checkbox" value="Timber" /></td>
</tr>
<tr>
<td>Repairs</td>
<td><input name="interest[]" type="checkbox" value="Repairs" /></td>
<td>PVC</td>
<td><input name="material[]" type="checkbox" value="PVC" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Secondary Glazing</td>
<td><input name="material[]" type="checkbox" value="Secondary Glazing" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Timber/Aluminium Composite </td>
<td><input name="material[]" type="checkbox" value="Timber/Aluminium Composite" /></td>
</tr>
</table>
<p><label accesskey="c" for="comments">Comments: </label>
<textarea cols="40" rows="8" name="comments" eform="Comments:html:1"></textarea></p>
<p>
Please enter the anti spam code below:
<img src="[+verimageurl+]" alt="verification code" border="1"/>
</p>
<p>
<label accesskey="c" for="vericode">Enter the code here:</label>
<input type="text" name="vericode" size="20" />
<input class="btn" type="submit" name="submit" value=" Send "/></p>
</form>
-
☆ A M B ☆
- 24,524 Posts
The "docs" folder in assets/snippets/eform contain example forms that show how to do this.
I cant find anything in those examples that is specific to my problem. This is the email response I am currently getting;
This is a response sent by kn ioj ij using the contact form on the website. The details of the message follow below:
Name: kn ioj ij
Address: ij;ji
City/Town: jij
County: jij
Postcode: ijoijiojio
Email: test@test
Tel: 798798
Comments: sdfgdsgsdg
Windows:
Steel:
The ’Windows’ and ’Steel’ sections are the checkboxes, when a customer ticks the specific product I am trying to get the number ’1’ to appear. At the moment no value is appearing, they just remain blank as you can see.
-
☆ A M B ☆
- 24,524 Posts
I don’t see any eform="..." attributes on any of those checkbox fields.
Can you give an example of how that should be formatted please?
Thanks
-
☆ A M B ☆
- 24,524 Posts
Thanks for the feedback everyone, Ive finally got it working.