JQuery Forms Ajax

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
wildwobby
Forum Commoner
Posts: 66
Joined: Sat Jul 01, 2006 8:35 pm

JQuery Forms Ajax

Post by wildwobby »

Hey,

Im trying to learn jQuery and wanted to figure out the ajax part of it.

I have a form and wanted it to load html into another div based on whats in the form. I can't figure out what the jQuery code is to to POST the values of each form to the php file...
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Code: Select all

$.post( url, data, callback);
You can also use $.ajax(), depending on your needs.

http://docs.jquery.com/Ajax/jQuery.post
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
wildwobby
Forum Commoner
Posts: 66
Joined: Sat Jul 01, 2006 8:35 pm

Post by wildwobby »

but how do you get to actually send the data in the form...
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

the "data" part is an object, you can build it on the fly like this:

Code: Select all

{name: $('#name').val(), title: $('#title').val()}
...etc...
Post Reply