Submitting form via xmlhttp request

S

Steve Swift

Is there a relatively simple way of achieving the effect of
this.form.submit() but sending the data via xmlhttp rather than doing
the actual submit?

I suspect I'd prefer a script library solution, such as jQuery or
prototype, if only to free me from browser differences.
I don't mind if I have to hardcode the method, or the action, but I'd
like to avoid having to collect all the "items" that make up the form,
if possible.

The form contains several checkboxes, and I'd like to trigger a "save"
of their status (on the server) every time any of them change, but
without refreshing the page.

There is no easily available sample page; the actual page is at
http://www.swiftys.org.uk/lists but you have to register a userid from
the homepage (a primitive mechanism) before you can reach this page, and
then construct a list of your own. It's the process I use to run me
through all the steps I need to take when changing my passwords, or
going on holiday, etc.

I'm hoping to avoid the necessity of the "Save Checks" button, by doing
it automatically, in the background.
 
G

Gregor Kofler

Steve Swift meinte:
Is there a relatively simple way of achieving the effect of
this.form.submit() but sending the data via xmlhttp rather than doing
the actual submit?

I suspect I'd prefer a script library solution, such as jQuery or
prototype, if only to free me from browser differences.
I don't mind if I have to hardcode the method, or the action, but I'd
like to avoid having to collect all the "items" that make up the form,
if possible.

I have my own solution here:
http://web.gregorkofler.com/index.php?page=form

There are shortcomings with feature detection and other stuff in my
scripts, but the collection of the field values takes up less than 30
lines (ajaxform.js).

Gregor
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top