Custom Code to send several E-Mails

hafisch 25 May, 2013
Hello everybody

I'm trying to integrate a simple mail-Form, where users can check the E-Mail recipients by selecting the users with a checkbox.
What i was trying to do now, was to create a custom event, in which i want to check the value of the checkbox in the "on submit" event.

What i wrote in the custom event was the fallowing code:

<?php

  if (document.getElementById("recipients").checked = true) {
    echo "recipients checked";
  }else{
   echo "recipients not checked";
  }

?>


I want to replace the echo-code with the mail-sending event after this code works.
But not even this code works. Not echo-line will be displayed at all. I made a dummy function with a simple text-output and no conditions. This output works, so the problem must be somewhere in the condition.
Is the function "document.getElementById" valid in the ustom code? Is there an fault in my code? Is there an easier way to check the values of the checkbox?

Thanks for your support and greetings from
hafisch
GreyHead 25 May, 2013
Hi hafisch,

Your code is part PHP and part JavaScript - you probably need it all to be PHP here.

Bob
This topic is locked and no more replies can be posted.