Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2008
    Location
    Albany, NY
    Posts
    73
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Question Over-riding Functions

    When I test certain codes on test pages, they work, but when I add them to my website, they don't. I am wondering if maybe certain functions are over-riding others?

    In my coding I have more than 1 form, but I named them differently from one another.

    For example:

    Code:
    <form name="forms" method="post" onSubmit="return check(this);">
    and

    Code:
    <form name="form1" method="get" onSubmit="return LengthValidator(this)">
    When I hit Submit, only one works. That is why I am thinking it may be over-riding the other function.

    If there is a way to fix this, it would help solve a lot of my coding troubles that I have been coming across lately.

    - Shannon -

  • #2
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    That's because submit buttons are specific to one form

  • Users who have thanked ninnypants for this post:

    nevfalath (01-20-2009)

  • #3
    New Coder
    Join Date
    Nov 2008
    Location
    Albany, NY
    Posts
    73
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Oh I see.

    Is there something else I can use that would work for more than one form?

    I am trying to validate two forms when the user clicks Submit, and if both check out, the user may proceed.

    - Shannon -

    EDIT: I see that many people suggest using frames. I would really prefer not to do this. Others have suggested creating a form that submits all forms, however most suggested codes seem to be unsuccessful.
    Last edited by nevfalath; 01-21-2009 at 01:02 AM.

  • #4
    New Coder
    Join Date
    Nov 2008
    Location
    Albany, NY
    Posts
    73
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Does anyone have any suggestions?

    What I am trying to do is verify that all fields have been filled in, but also verify that the length of the password is between 6 and 20 characters. I have the coding for both, I just can not seem to have the submit button check both, because as previously informed, they only verify one function.
    - Shannon -

  • #5
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by nevfalath View Post
    Does anyone have any suggestions?

    What I am trying to do is verify that all fields have been filled in, but also verify that the length of the password is between 6 and 20 characters. I have the coding for both, I just can not seem to have the submit button check both, because as previously informed, they only verify one function.
    you can use another function to submit, same for all forms, form name to detect which form submit the data and call the apropriate function to check and validate.

    best regards


  •  

    Posting Permissions

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