Submitting multiple forms on one page

Discussion in 'Javascript' started by belzibob, Aug 19, 2003.

  1. belzibob

    belzibob Guest

    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
    belzibob, Aug 19, 2003
    #1
    1. Advertising

  2. belzibob

    Fred Basset Guest

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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Fred Basset, Aug 27, 2003
    #2
    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. NeoPhreak

    Submitting Multiple Forms

    NeoPhreak, Oct 21, 2003, in forum: HTML
    Replies:
    9
    Views:
    509
    Whitecrest
    Oct 22, 2003
  2. Steven Reid

    Submitting forms second time just resets page

    Steven Reid, Dec 29, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    7
    Views:
    188
    Steve Kirchner
    Feb 2, 2005
  3. Bjorn

    submitting two forms in same page?

    Bjorn, Jul 28, 2004, in forum: ASP General
    Replies:
    3
    Views:
    144
    Bjorn
    Jul 29, 2004
  4. Replies:
    0
    Views:
    121
  5. paratge

    Submitting two forms in one click

    paratge, Apr 16, 2007, in forum: Javascript
    Replies:
    4
    Views:
    131
    paratge
    Apr 16, 2007
Loading...

Share This Page