I want to return the visitor an email with information specified from checkboxes in a html form. I've got the send mail working fine but I can't determine which checkboxes have been ticked or not. Here's my code - The form:
<input name="checkbox1" type="checkbox" value="on">
<input name="checkbox2" type="checkbox" value="on">
<input name="checkbox3" type="checkbox" value="on">
and the perl:
my $passwords="";
if($formdata{'checkbox1'} == 'on'){
$passwords = "password1\n";
}
if($formdata{'checkbox2'} == 'on'){
$passwords = $passwords . "password2\n";
}
if($formdata{'moves'} == 'on'){
$passwords = $passwords . "password3\n";
}
BUT the return email sends out all 3 passwords regardless of how many checkboxes have been ticked or not? Any help much appreciated!
<input name="checkbox1" type="checkbox" value="on">
<input name="checkbox2" type="checkbox" value="on">
<input name="checkbox3" type="checkbox" value="on">
and the perl:
my $passwords="";
if($formdata{'checkbox1'} == 'on'){
$passwords = "password1\n";
}
if($formdata{'checkbox2'} == 'on'){
$passwords = $passwords . "password2\n";
}
if($formdata{'moves'} == 'on'){
$passwords = $passwords . "password3\n";
}
BUT the return email sends out all 3 passwords regardless of how many checkboxes have been ticked or not? Any help much appreciated!