2 Replies Latest reply on May 27, 2014 12:56 AM by smeedee

    Can anyone tell me what's wrong with this code?

    smeedee Level 3

      I'm trying to show an 'X' icon next to the offending error. If I take out the 'if' test the code runs. If I leave it in the symbol won't run.

       

      Thanks

       

      David

       

       

      var emailFromVal = Email.value;

      var messageVal = "<strong><p><font face='helvetica' size='5'> Name : "+Firstname.value+"<br><br> Last Name: "+Lastname.value+"<br><br>  Message : "+Message.value+"</p>";

      // we add this variable to make sure if anyone find out the address of our php file cant send empty message by calling php file by url

      var Permission = 1;

       

       

      if ((Firstname.value == ""){

      //move error marker to correct x,y and show error has occurred

      sym.$("cross").css('left', 10);

      sym.$("cross").css('top', 90);

      sym.$("cross").show();

      }

      else{

      alert("Thank you, we will contact you shortly");

      $.post("sendEmail.php",{ flag:Permission, email:emailFromVal, message:messageVal });

      }

       

       

      sym.$("#Email").detach();

      sym.$("#Firstname").detach();

      sym.$("#Lastname").detach();

      sym.$("#Message").detach();

       

       

       

       

      Permission = 0;

      sym.play("sent");