If my php variable, (which is retrieved from a mysql table in the php code, not shown) is equal to "1", that means the member is not eligible to submit the form, so I want an alert() to say "member not eligible!". Else, I want it to continue to submit the form. Here is my code (which I can't seem to get to work):
<head>
<script src="js/jquery-1.4.2.js" type="text/javascript">
//here is the script in question
<script type="text/javascript">
<!--
function MoveOn() {
var mem_eligible = "<?= $is_mem_eligible ?>"; //that's my php variable
if (mem_eligible == "1") {
alert('You are not yet eligible, please try again tomorrow!');
return false;
}
}
-->
</script>
</head>
<form name="myform" action="postform.php" method="post" enctype="multipart/form-data">
<div>
<input type="submit" name="Submit2" value="Submit Entries" onsubmit="return MoveOn()"/>
</div>
</form>
Please help, thanks!
June