The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 4 of 4

Thread: got my checkbox in mailform almost working...

  1. #1

    got my checkbox in mailform almost working...

    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".$pla ats."\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.
    registro ergo sum

  2. #2

  3. #3
    ah, that's what you probably mean by crossposting.
    registro ergo sum

  4. #4
    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...
    CyanBlue / Jason Je / Flash Developer
    http://CyanBlue.FlashVacuum.com
    http://www.FlashVacuum.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012