Is there away to submit an entire form through Ajax?

1st of October 2012 2

Is there away to submit an entire form through Ajax?

For example, if you make a regular form and submit it, it will automatically send all the information in that form to the specified action place. Well is there a way to send all that information autmatically through jQuery? Do you understand? It’s kinda hard to explain, but I hope someone gets it.

Best answer:

Answer by st. anger
no

What do you think? Answer below!

Filed under § jquery forms — Tagged with , , , , , ,

Share it!

Was it good for you to?

Sponsors

Support for the site!

No sponsors at the moment.



2 great comment(s) for this post

  1. vinlandviking 11:27 pm 1/10 of 2012

    My favorite jQuery plugin for working with forms is the ‘jQuery Forms plugin’ (http://malsup.com/jquery/form/). Right there on the first page is an example which I believe covers what you are looking for.

    Reply
  2. Rockstar 12:02 am 2/10 of 2012

    Yeah, I understand. It kind of depends on whether you’re just trying to store the information, or if you need to parse the information and return something back to the user. If you just need to store the information, simply create a 0px by 0px iFrame and submit to that via POST. If you need to parse the information, you’ll need to create a GET string in the form of http://www.site.com/path-to-your-parser.php?firstVariable=Some%20Value&secondVariable=Another%20Value&thirdVariable=Yet%20Another%20Value. I hope that shows up on answers… Then when you connect to your serverside request, send that URL as the connection URL. You will be able to treat that as any other from GET request on the serverside.

    If you need to send a large amount of information and you want to use the POST method, you’ll need to build basically the same string without the http://www.site.com/path-to-your-file.php? part and just send the variables in the form of username=Horace&email=horace@aol.com&body=a%20whole%20bunch%20of%20text.

    put all that in a variable called params and use it as a parameter for your SEND function of your HttpRequest:

    XMLdoc.send(params)

    look at this page: http://www.openjs.com/articles/ajax_xmlhttp_using_post.php for more info on that.

    Anyway, you simply need to go through and put all your values from your form into one string and send that. Then parse it on the other side.

    Reply

Your opinion matters. Add it below.


Tip: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent comments

Categories



Copyright jqueryui.info since 2010. All rights reserved. Design and the Absolute Theme by Tommie Hansen.