hello,
I am trying to add a checkbox to my mailform using PHP. When I send the mail,
the output of the checkbox var (‘dvd’) gets through, but it is always “yes”, no matter whether you click it or not.
I am using the change Handler (named it “checkState”), and i have tried 'getValue’and ‘selected’, but the problem stays.
these are the codes:
in the main timeline the change Handler function (i first tried “false”; instead of false, same result):
function checkState()
{
if (form.dvd.selected=false)
form.dvd = “no”;
else
form.dvd = “yes”;
}
on the submit button:
on (release) {
checkState();
form.loadVariables(“email.php”, “POST”);
}
PHP code (dvd is from the checkbox, the others are textfields that work fine):
<?php
$naam = $_POST[‘naam’];
$tel = $_POST[‘tel’];
$straat = $_POST[‘straat’];
$plaats = $_POST[‘plaats’];
$vraag= $_POST[‘vraag’];
$dvd= $_POST[‘dvd’];
$message = $naam."
“.$email.”
“.$tel.”
“.$straat.”
“.$plaats.”
“.$vraag.”
".$dvd;
$sendTo = “jeff@winder.demon.nl”;
$subject = “Macro Videoprodukties Emailformulier”;
$headers = "From: " . $_POST[“naam”];
$headers .= “<” . $_POST[“email”] . ">
";
$headers .= "Reply-To: " . $_POST[“email”] . "
";
$headers .= "Return-Path: " . $_POST[“email”];
mail($sendTo, $subject, $headers, $message);
?>
I searched the forums, got some suggestions for non-component checkboxes, but I just can’t find the answer for this one, so any ideas would be great!
Thank you very much,
Jerryj.