I have been searching an answer for like three days but still cannot find one that works. I have this if statement in javascript block:
if (!(/@test.com\s*$/.test(document.forms["myForm"]["email"].value))) {
alert("Please Enter Correct Email Domain");
return false;
}
I need to have this:
var javaScriptVar = "<?php echo $ar[1]; ?>";
to replace the test.com part in the if statement. Any idea how to do this? Thanks.