Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

How do I make group of checkboxes with a one line result in the templates?

Author: Eileen Wilde Reference Number: AA-00191 Views: 8337 Last Updated: 08/10/2009 11:42 AM 0 Rating/ Voters

To make a group of checkboxes you need to give them names like interests[] (as is shown in the example)

Example:
<table>
<tr>
<td>
<label>
<input type="hidden" value="" name="interests[]">
<input type="checkbox" name="interests[]" value=" Finance News" checked>Finance News
</label>
</td>
<td>
<label>
<input type="checkbox" name="interests[]" value="Chat" checked>
Chat
</label>
</td>
</tr>
<tr>
<td>
<label>
<input type="checkbox" name="interests[]" value="Weather">Weather
</label>
</td>
<td>
<label>
<input type="checkbox" name="interests[]" value="Other" checked>Other
</label>
</td>
</tr>
</table>

When you receive data from this group of checkboxes and acquire the list of comma-separated values for the checked checkboxes you use the {#interests#} variable.

Result (if we check first, second and forth checkboxes):

 Finance News, Chat, Other