Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-18-2009, 03:44 AM   PM User | #1
nevfalath
New Coder

 
Join Date: Nov 2008
Location: Albany, NY
Posts: 73
Thanks: 16
Thanked 0 Times in 0 Posts
nevfalath can only hope to improve
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 -
nevfalath is offline   Reply With Quote
Old 01-18-2009, 04:19 AM   PM User | #2
ninnypants
Regular Coder

 
ninnypants's Avatar
 
Join Date: Apr 2008
Location: Utah
Posts: 504
Thanks: 10
Thanked 47 Times in 47 Posts
ninnypants is an unknown quantity at this point
That's because submit buttons are specific to one form
ninnypants is offline   Reply With Quote
Users who have thanked ninnypants for this post:
nevfalath (01-20-2009)
Old 01-20-2009, 10:52 PM   PM User | #3
nevfalath
New Coder

 
Join Date: Nov 2008
Location: Albany, NY
Posts: 73
Thanks: 16
Thanked 0 Times in 0 Posts
nevfalath can only hope to improve
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 12:02 AM..
nevfalath is offline   Reply With Quote
Old 01-25-2009, 03:58 PM   PM User | #4
nevfalath
New Coder

 
Join Date: Nov 2008
Location: Albany, NY
Posts: 73
Thanks: 16
Thanked 0 Times in 0 Posts
nevfalath can only hope to improve
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 -
nevfalath is offline   Reply With Quote
Old 01-26-2009, 08:25 AM   PM User | #5
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
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
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:23 PM.


Advertisement
Log in to turn off these ads.