469,327 Members | 1,219 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Submitting multiple forms on one page

I have inherited a table where each row is a <form>

Each of these rows has only four columns, those being:
1) Item number
4) Quantity (blank textbox to fill in)
3) Description
4) Add link (to add just this one item.

That works fine but, now they want to have a submit button at the top
of the page, that when clicked, will submit every form whose quantity
has a value.

I have been searching, reading, and trying everything I could find
(I'm not a javascript programmer) to no avail.

Is this even possible? How can I accomplish this.

Thx
Jul 20 '05 #1
2 6163
belzibob wrote:

[snip]
That works fine but, now they want to have a submit button at the top
of the page, that when clicked, will submit every form whose quantity
has a value.

[snip]

It doesn't make sense to do this. Each form can return a document. What
should a browser do with them all?

Rewrite the document to use a single form, and have the server-side script
do the work.

--
Jim Dabell

Jul 20 '05 #2
Submitting a form on a web page has the same effect as clicking a link.
It will take you away from that page and on to the one specified by the
form (or determined by its action).

Theoretically you could submit all the forms on the page by writing ...

for (i=0; i<document.forms.length; i++) {
document.forms[i].submit();
}

... the problem is that you might as well just try and click all the
links on the page at the same time instead ;)

The solutions are either to (tidier) rewrite the page to use only one
form or (less modification of current code) call a function which puts
the details of all the current forms into a new single one. The former
would be the preferable one.

Fred Basset
fr*********@whosyourdaddy.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Greg T | last post: by
4 posts views Thread by Tauqir | last post: by
4 posts views Thread by paratge | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.