Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AJAX question

Status
Not open for further replies.

WebRic

Technical User
Joined
Sep 21, 2004
Messages
95
Location
GB
Hi All,

Can AJAX be used to submit a form without reloading the rest of the page.

note: I know there are ways of doing this with iFrames but this is not suitable for my purposes.

Thanks,


Richard
 
Cheers Jeff.

R
 
Can you really "submit a form"? I know you can send GET or POST data, but that's not really the same thing as submitting a form. Particularly since you have to manually take the data from the form fields and build the GET/POST data to send to the URL. Don't you?

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
What do you mean by "submit a form" ???

Do you mean send an HTTP request to the server that includes form elements and their values?
 
afaik, i don't think there's a difference... typically "submitting" a form means triggering a POST of the form's field's values. so whether this is done via a submit button or sending a POST via xmlhttp shouldn't matter to the receiving url/form action.

-jeff
lost: one sig, last seen here.
 
You're right, if you do it correctly it won't matter to the receiving program at all, but it matters a great deal to the sending program. When you submit a form the browser automatically takes the data from the form fields and creates the query string or post data to send to the form processing program. When you use an HTTP request you must take the values of the form fields and create the query string or post data yourself.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top