SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2008
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    including multi tabs in one form ... how ??

    hi ,
    please i have two pages i included it to preview it in one page by tabs (ajax) ..
    but i have problem .. each page contain form with submit button . to send form fields ..
    the problem is that i want make one submit button to this two pages . to send each form fields ... how to do this with external pages including using ajax

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have a few options:
    - make it into one big form, with <divs> inside that represent the different tabs (easiest and cleanest method)
    - employ an onsubmit event handler to copy the contents of each "other" form onto the one being submitted (ugh)
    - somehow submit the rest of the forms separately when user tries to submit one of them

    In short, if you can get away with one form that spans multiple tabs (tabs are normally divs that get hidden/displayed, no?) you will make your life easier.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2008
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks lot jimfraser .. can u provide me with your prefered method

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd lay it out like this:
    Code:
    <form>
    <div id="tab1">
    <input.....>
    <input.....>
    <input.....>
    </div>
    <div id="tab2" style="display:none;">
    <input.....>
    <input.....>
    <input.....>
    </div>
    <div id="tab3" style="display:none;">
    <input.....>
    <input.....>
    <input.....>
    </div>
    </form>
    Then have your script hide/show the divs depending on which tab control btn is clicked


Bookmarks

Posting Permissions

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