JQuery Help. Submitting Form
Hi,
I am new to JQuery and I think I am having a simple problem. I am submitting a form with JQuery and I have a separate file that processes what is going on in the jquery.
I am looking to load the processing files contents while the file is processing.
Here is my code:
-
$(function() {
$(".buttonss").click(function() {
$('.error').hide();
var user = $("input#user").val();
var email = $("input#email").val();
var game = $("input#game").val();
var dataString = 'user='+ user + '&email=' + email + '&game=' + game;
// alert (dataString);return false;
$("#contact_form").html("<p><img src=\'../images/ajax-loader.gif\'></p>");
$.ajax({
type: "POST",
url: "/includes/process.php",
data: dataString,
success: function() {
// Here is where I want to load what happended in the process.php page. This isn't working.
$("#contact_form").load("../includes/process.php",{"email" : email}, {"user" : user}, function() {
});
}
});
return false;
});
});
The issue is in the success function. I want the content of the includes/process.php page to load it's contents. For example, if a user is already on the list, it will say. "Sorry, you are already on the list."
Any ideas?