0

I'm so confused so please be patient

I use pear 1.9.0 and I have this simple code for sending e-mails.

 <script type='text/javascript'>
function contactsendBack(f){
   //mes is a div to render messages to the user
    document.getElementById("mes").innerHTML="";

   //if the user wants to input some mails to the textfiled, but the textfield is actually empty...
   if(f.elements['pick'].value=="opt"  && f.elements['sendm'].value=="" ){  document.getElementById("mes").innerHTML="Duh, no mails"; return false;}

   //if the user wants to input some mails to the textfiled and also include admin's mail to the list, but the textfield is actually empty...
   else if (f.elements['pick'].value=="admopt"&& f.elements['sendm'].value==""){document.getElementById("mes").innerHTML="Duh, no mails"; return false;}
   else
      {
                  //ok, no errors now, so send to server
             jQuery.post("contactsendBack.php", { 
              name : f.elements['name'].value ,
              mymail : f.elements['mymail'].value ,
              pick : f.elements['pick'].value ,
              sendm : f.elements['sendm'].value ,
              subj : f.elements['subj'].value ,
              comment : f.elements['comment'].value 


              }, function(data) {
             //render what  contactsendBack.php echos...could be "send ok" or "error"
              $('#mes').html(data);
               });   

       return false;

       }
    }

     </script>


//        the html
        <form  action="#"  onSubmit="return contactsendBack(this); return false;" method="post" enctype="multipart/form-data">   
        Name:<br>
        <input name="name" id="name" type="text" required ><br>
        Your e-mail:<br>
        <input name="mymail" id="mymail" type="email"  value="<?php echo $defm ?>" required ><br>

        <input type="radio" id="pick" name="pick" value="adm" checked = "checked">Admin<br>
        <input type="radio" id="pick" name="pick" value="opt">What I set to the textbox<br>
        <input type="radio" id="pick" name="pick" value="admopt">Admin AND What I set to the textbox<br>
        <input type="radio" id="pick" name="pick" value="all">Everyone<br>


        Set some mails:<br>You can input more than one mail. Separate by commas<br>
        <input name="sendm" id="sendm" type="textarea"  rows="24" cols="50"  ><br>

        Subject:<br>
        <input name="subj" id="subj" type="text"  required><br>
        Text :<br>
        <input name="comment" id="comment" type="textarea"  rows="24" cols="50"  required >
         <br>

         <input type="reset"  id="res" name="res"/>
         <input type="submit" id="sub" name="sub"/>
        </form>

This works fine with Chrome. Echos "send ok" and I can see a new mail in my mail account. But in Firefox and IE echos "send ok" and I see no new mails in my account.

I also use j-query 1.8.2

I see no errors in IE and FF console.

I just dont get it. has to do with the browsers? The server side (contactsendBack.php)? The front-end?

How do I fix this?

Any ideas? Im stuck

Thanks

slevin
  • 4,166
  • 20
  • 69
  • 129

1 Answers1

0

Inspect the values you get POSTed to your script and compare the different browser versions. There will probably a difference - eleminate that.

cweiske
  • 30,033
  • 14
  • 133
  • 194