0

Does anybody know of a simple jQuery form processing tutorial that actually works?

I have a form I want to process via jQuery/Ajax nothing difficult in PHP but in jQuery and AJAX can I get it to work - no, all the tutorials are based round sending e-mails (or just lists of more lists of more lists of tutorials - hate those)

All I want to do is learn how to send a form via jQuery and AJAX to another page, save the data in a DB without having to leave the first page. I have tried all sorts but nothing works properly. Here is my form:

<form id="form">
<input type="text" name="abc" />
<input type="text" name="def"/>
<input type="text" name="ghi"/>
<input type="submit" name="try" id="try" />
</form>

Now what do I actually do? Sounds silly I know (and I guess I'll get another -1 star for this question) but I will be honest a GOOD simple tutorial would be really useful not just to me but to the others. I know php but jQuery/Ajax - just don't know/understand. I will not be alone

1

3 Answers 3

1

This is one of the good tutorials on how to submit forms using ajax and php.

Sign up to request clarification or add additional context in comments.

Comments

1

This link is a reference teaching how to submit forms via jQuery/AJAX. Have the form post to a PHP page to handle the form data.

In short, your jQuery code would look similar to this:

$("#form").submit( function()
{
    // Handle validation or any extra data here.
    // Return true if validation passed and the data should be posted
    // Return false if the form should not be submitted

    // You can also do any extra work here that you like before returning,
    // including changing something on the page or showing the user a message.
}

Comments

1

There's a cracking plugin for this:

http://plugins.jquery.com/project/form/

It's as easy as:

$('#myForm').ajaxForm(function() { 
    alert("Thank you for your comment!"); 
}); 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.