J Talbot wrote:
If I have three checkboxes with different values on a form like :
<input type="checkbox" name="checkbox" value="1stValue">
<input type="checkbox" name="checkbox" value="2ndValue">
<input type="checkbox" name="checkbox" value="3rdValue">
And I needed to submit that form so that the values end up in a text field
called CHECKBOX_TERMS with an AND in between each, so that the text field
on the same form has in effect '1stValue AND 2ndValue AND 3rdValue'
contained within it.
Which is the best way to do it ?
To change the server side script.
Something along the lines of:
my $CHECKBOX_TERMS;
my $sep = "";
foreach my $checkbox ($cgi->param('checkbox')) {
$CHECKBOX_TERMS .= $sep . $checkbox;
$sep = " AND ";
}