POST a form with XmlHttpRequest

H

Henri-Bastien

ok here is my problem I have a form in a webpage that I want to submit
and get the result back without reloading the page.

I've seen many times ppl using text/x-www-form-urlencode but I was
wondering if it was possible somehow to submit the form element
directly so I wouldn't have to process the form to put it in a string.

If there is anyway I would be happy if not seems I'll have to
transform the form into a string request.

Thanks in advance for your help.
 
M

Martin Honnen

Henri-Bastien said:
If there is anyway I would be happy if not seems I'll have to
transform the form into a string request.

XMLHttpRequest is mostly meant to exchange XML as data so you can
directly pass a DOM node like an XML DOM document to the send method but
if you want to send form data as application/x-www-form-urlencoded
content then you have to build that string yourself from the form that
you can walk with the DOM to build the string.
 
M

Metaphis

I don't need to send it in x-www-fomr-urlencoded only thing I need is
to get the same result as doing form.submit without having to reload
the page AND being able to get the result back. Because the script run
localy but I access a remote page. For that reason I can't simply put
the form in an other frame because DOM doesn't allow that in
explorer....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top