if Field1="" then
response.write "Please fill in Field Area"
else
response.write "Thank you, the form has been submitted successfully"
end if
<script type="text/javascript">
var submitted = false;
function CheckSubmitted()
{
if (submitted == true) { return false; }
else { submitted = true; return true; }
}
</script>
<form name="form1" action="post" onSubmit="return CheckSubmitted();">
.......
</form>
$("form").on("submit",function(e) {
e.preventDefault();
var querystring = $(this).serialize();
$.get(this.action+"?"+querystring,function(data) {
if (data.indexOf("thank") !=-1) $("this").hide();
});
});
$(document).ready(function(){
$("#myform").validate({
var $form = $(this);
submitHandler: function(form) {
var querystring =$form.serialize();
$.get(form.action+"?"+querystring,function(data) {
if (data.indexOf("thank") !=-1) $.fancybox.close();
});
}
});
});
<!-- "import" your js file -->
<script type="text/javascript" src="js/ajaxsbmt.js"></script>
<!-- now provide a new function named updatepage -->
var updatepage = function(serverResponse, contentDiv)
{
//here you do whatever you want with the response
if( 'Thank you'==serverResponse.substring(0,9) )
{
//now disable the button. Suppose you have
//<input id="mainButton" ...>
document.getElementById('mainButton').disabled=true;
}
document.getElementById(contentDiv).innerHTML=serverResponse;
};
function updatepage(str,responsediv){
if( 'REDIRECT-TO: '==String(str).substring(0,13).toUpperCase() )
top.location.href=str.substring(13);
else
document.getElementById(responsediv).innerHTML = str;
}
var updatepage = function(serverResponse, contentDiv)
{
//here you do whatever you want with the response
if( 'Thank you'==serverResponse.substring(0,9) )
{
//now disable the button. Suppose you have
//<input id="mainButton" ...>
document.getElementById('mainButton').disabled=true;
}
document.getElementById(contentDiv).innerHTML=serverResponse;
};
<input class="UpFF" id="mainButton" type="submit" name="Submit" value="Insert <%=Mach%>" tabindex="9"/>
if( 'THANK YOU'==serverResponse.substring(0,9).toUpperCase() )
http://docs.jquery.com/Plugins/Validation
(The first example)
However, I cannot get it to work with my site.
Of which is loading inside of a "fancybox"