jquery and ajax response text not working

Joined
12 Feb 2006
Posts
17,672
Location
Surrey
not sure what i'm doing wrong.

this is my jquery

Code:
			$.ajax({
				type: "POST",
				url: '/p/process_cForm.php',
				data: "cName="+cName+"&cPhone="+cPhone+"+&cEmail="+cEmail+"+&cMessage="+cMessage+"&cCopy="+cCopy,
	
				error: function(data) {
				alert('error1: '+data);
				},
				success: function(data) {
				alert(data);
				if(data == "123") {
				$("#cForm").fadeOut('fast');
				$("#cFormResult").fadeOut('fast');
				$("#cFormSent").html("Thank you for getting in touch with Green Clean. We will be replying soon.");
				$("#cFormSent").fadeIn('fast');
	
		
				}
				else {
				$('#cFormResult').html(data).fadeIn('fast');
				alert('Load was performed.'+data);
				}
				}
 
			});

and this is a rough idea of my php file of the part i'd figured would be needed

PHP:
$returnVal = 123;
return($returnVal);

the alert to show the data after success is always blank and it's driving me crazy
 
Back
Top Bottom