Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Can I make a submit button from one form also submit a second form's info?

I have a situation where I have a lengthy series of html forms that need to be filled in. Enough of them that people may not want to do it all in one go.. Long story short. there's a navigation bar (made of form submit buttons)at the top of the page that lets you move around within the forms and update or change info.. and then there is the submit button for the form you are filling in.

Sometimes people are using the navigation menu as the "Next" button.. can I just make that work for them using JS of some kind? .. SO like the sumbit button from form A also submits any filled in info from form B even though they are not contained in the same form tag..

1 Answer

Relevance
  • Dan
    Lv 4
    10 years ago
    Favorite Answer

    Yeah... that architecture doesn't work too well because you have to remember a bunch of values between one form and the next: a better way is to have one big form with everything in it, and use Javascript to hide and show bits of the form depending on what you press on the top (so instead of being submit buttons, the scripts kick off javascript functions to show and hide the elements). Check out my site: http://www.opwernby.com/ -- press "log in" and you'll see what I mean: the form has tabs on it that you can press, but in reality, it's not submitting anything when the tabs change. If you do "View Source" on my site, you can see the script files involved: feel free to download them all.

    If you have to remember values between pages, then you're going to have to replicate every field on every form as hidden fields on the other forms, then set the values accordingly every time each form loads -- this is another way to do it ( <input type="hidden"> ) -- assuming you have some kind of backend scripting language like ASP or PHP, that's not too hard to do.

    Source(s): 32 years of programming experience
Still have questions? Get your answers by asking now.