hello can somone please tell me why i cannot submit this twice i have a php form doing the validation and mailing but if there are errors in the form filling out it will send back an errorand tell them to fix it, without refreshing the form.
the problem is the seccond time i click submit it does the initial form hide but stays stuck on sending the data to the php form again, could it be a cache issue and if so please show where exactly i should put the data or math multiplier because if i put it in the url by say adding url:'mailer.php' + date(), this then causes the program to fail, so any help would be apprieciated.

$(document).ready(function() {
	$("#Register").click(function(){
  	$("#Form").hide('fast');
	$("#LoadingMessage").animate({marginTop:"150"}).fadeIn('slow');
	var formData = $('#Form').serialize();
	submitForm(formData);
	return false;
	});
});
	function submitForm(formData){
        $.ajax({
        	
	   type:'POST',
            url: 'mailer.php',
            data: formData,
            dataType: 'json',
            cache: false,
            timeout:7000,
            success:function(data){
           if(data.success == true){
            $("#LoadingMessage").hide('fast');
		$("#Thankyou").fadeIn('slow');
	}else{
             $("#LoadingMessage").hide('fast');
			 $("#Error").fadeIn('slow').delay(2000);
			 $("#Error").fadeOut('slow');
			 $("#Form").delay(4000).show('fast');
				 
           }
          }
    });
};

any help please
thank you in advance.

POST requests should not be cached. You might want to do some logging, what data does the server get, does it respond correctly?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.