POST a form with XmlHttpRequest

Discussion in 'Javascript' started by Henri-Bastien, Mar 23, 2005.

  1. 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.
     
    Henri-Bastien, Mar 23, 2005
    #1
    1. Advertising

  2. Henri-Bastien wrote:

    > 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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 23, 2005
    #2
    1. Advertising

  3. Henri-Bastien

    Metaphis Guest

    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....
     
    Metaphis, Mar 23, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Don Glover the younger

    ASP, FORMS, POST METHOD And Post with out form(???)

    Don Glover the younger, Jul 13, 2003, in forum: ASP General
    Replies:
    0
    Views:
    518
    Don Glover the younger
    Jul 13, 2003
  2. J. Muenchbourg
    Replies:
    0
    Views:
    409
    J. Muenchbourg
    Aug 6, 2003
  3. Jarson
    Replies:
    5
    Views:
    527
    Lasse Reichstein Nielsen
    May 10, 2005
  4. gp
    Replies:
    1
    Views:
    136
  5. Mike Winter

    Re: XMLHttpRequest: POST with Data

    Mike Winter, Aug 26, 2012, in forum: ASP General
    Replies:
    0
    Views:
    2,090
    Mike Winter
    Aug 26, 2012
Loading...

Share This Page