www.webdeveloper.com
Results 1 to 5 of 5

Thread: Mutiple Forms and One Submit Button

  1. #1
    Join Date
    Mar 2014
    Posts
    70

    Mutiple Forms and One Submit Button

    I have currently using a a tab structure on each tab i have separate form.. .. more after form submit i want to move back to the same tab so i got an idea to use href on click event..
    but i don't to create multiple buttons to submit the forms.

    any help?

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,391
    Can you describe your problem differently? I'm not sure I understand the problem.

    If you are trying to return to the same tab(?) last selected by the user?
    You could consider using a cookie or localstorage to return to a particular display.

    If you are trying to create multiple forms, perhaps you can give and id value to each one
    and call the submit for a particular form with: document.getElementById('formID').submit();

    Do you have an example site or some code to demonstrate the problem you are having?

  3. #3
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    I don't know how you have you're tabs setup or how you switch between them.
    I suggest adding a hidden form field in each form, like
    HTML Code:
    <form id="form1">
      <input type="hidden" name="thisForm" value="form1">
      ...
    </form>
    <form id="form2">
      <input type="hidden" name="thisForm" value="form2">
      ...
    </form>

  4. #4
    Join Date
    Mar 2012
    Posts
    1,650
    If you are submitting a form using a submit button, why are you using JavaScript to process it??? What are you doing with the form data? You might be better off using PHP.

  5. #5
    Join Date
    Sep 2012
    Location
    Germany
    Posts
    22
    Hmm maybe i didnt understand this question.
    Do you mean something like this: http://neundorf.vela.uberspace.de/we...ple-Forms-and/
    SourceCode here: https://github.com/Naxmeify/webdevqs...and/index.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles