SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We have two separate forms that need to be submitted together.

    The first form gathers certain information.

    The second form gathers more information and the submit images for both forms are contained within this form.

    The first submit image submits the first form to a servlet to be validated. If it comes back OK, then the second submit button will actually submit both forms together.

    This is what we want to be able to do. Can this be done? Does someone have the JavaScript or whatever that would help us do this?

    You help is greatly appreciated in advance.

    Thanks,
    Design Guy

  2. #2
    SitePoint Zealot zeeshan's Avatar
    Join Date
    Mar 2001
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I might be missing something here, but won't it be easier to simply send the entire form through once (form 1 and 2), and see if entries in form 1 validate.

    If they do, go ahead and process the forms (email, add to database, whatever). But if form 1 entries do not "validate", simply return back from your script displaying an error on the resulting page. The user can hit back and correct the entries - then resubmit.

    I would go about using Perl I think - makes more sense - however PHP, or even Javascript validation would seem okay.

  3. #3
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with zeeshan that sending the entire form would be better/easier, or using JavaScript validation instead.

    However, if you absolutely need both forms merged into one to submit, you could use JavaScript to grab the values from the first form, and assign them to hidden form fields of the second form. Seems like a lot of hassle to me, but it's an option.

  4. #4
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the input so far, guys....

    Actually, JavaScript form field validation would be an option but unfortunately these particular fields in the first form need to be checked against a database for validity before the second form can be sent through; etc. ... Any more ideas?

  5. #5
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a reason why you can't send the info from the second form when you send in the first? You don't have to do anything with the information but why can you not just send it along and leave it alone unless the first info checks out?
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums


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
  •