html-php form submission after validation through JavaScript [closed]
PHP Snippet 1:
<form id="myform" action="process.php" method="post" onsubmit="return validate();">
//some form elements here
<input type="submit" value="Submit this form" />
</form>
<script type="text/javascript">
function validate(){
...
if(!valid)
alert('Error');
return valid;
}
</script>