PDA

View Full Version : got my checkbox in mailform almost working...



jerryj
March 6th, 2005, 05:51 AM
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."\n".$email."\n".$tel."\n".$straat."\n".$plaats."\n".$vraag."\n".$dvd;

$sendTo = "jeff@winder.demon.nl";
$subject = "Macro Videoprodukties Emailformulier";

$headers = "From: " . $_POST["naam"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$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.

CyanBlue
March 6th, 2005, 10:09 AM
http://www.actionscript.org/forums/showthread.php3?t=66829

jerryj
March 6th, 2005, 10:39 AM
ah, that's what you probably mean by crossposting.

CyanBlue
March 6th, 2005, 10:51 AM
Nope... I was just trying to tell you that I have replied to your question at the AS.org so that somebody else who has the same problem could go to that thread and see what possibly can help them...

When I said crossposting, that only applies to one forum... I see that you've made several threads at the Kirupa with the same problem... That won't be that good for somebody who's trying to help you keep track of where you are and how you are doing... and that won't be so easy for somebody who's got the same problem to know what the solution is because your posts are scattered...

So, it'd be great for everybody's sake to keep one question to one thread...