Results 1 to 7 of 7

Thread: two onSubmits on one form

  1. #1
    Join Date
    Nov 2008
    Posts
    19
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Question two onSubmits on one form

    1) Script Title: Required field(s) validation and Submit Once! Form validation

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...uiredcheck.htm
    and
    http://www.dynamicdrive.com/dynamici...submitonce.htm
    3) Describe problem:
    I have been trying to get this to work but everything I do only one or the other works. What I am trying is to have both of the scripts above on my form and run one after another using the onSubmit tag below.
    Code:
    <form onSubmit="return formCheck(this); && submitonce(this)">
    Is this the right way to do this? or is there another way to have the validation run then the submit once run

    thanks,
    Barry "OwT"
    Last edited by owt200x; 12-23-2008 at 07:04 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No, and even doing it the right way might cause a conflict between the two scripts. But, that said, the proper method would be:

    Code:
    onsubmit="return (formCheck(this) && submitonce(this));"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    owt200x (12-23-2008)

  4. #3
    Join Date
    Nov 2008
    Posts
    19
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default

    thanks John, I'll put that in there. Hopefully theres no conflict between those 2 scripts, if there is, then I dont know what to do.

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If there is, post a link to your page, as in:

    Please post a link to the page on your site that contains the problematic code so we can check it out.


    Most conflicts are fairly easy for me to resolve once I see the two scripts attempting to function together on a live page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #5
    Join Date
    Nov 2008
    Posts
    19
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default

    I only have the submitonce code in it right now, I was wanting to add the validation script to save bandwidth.

    my contact form is at http://www.owt200x.us/contactform

    their are two demo forms, one uses OpenCaptcha, the other uses MathCaptcha
    the code is also on the site for download it you wanted to look at it

  7. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are no obvious script errors or conflicts on that page. What's the problem?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #7
    Join Date
    Nov 2008
    Posts
    19
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default

    the problem was I didn't know how to have two onSubmits but you showed me how. thank you. I don't have both the scripts on the page right now, I was waiting until I could get both in the onSubmit. It only has the submitonce script

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
  •