943,720 Members | Top Members by Rank

Ad:
Jul 29th, 2008
0

onSubmit vs onClick

Expand Post »
My script works successfully when I validate a form field using;

<input type="submit" onClick="return chkrange(this.form)"

But, when I remove the onclick from the input type and try to use

onSubmit="return chkrange(this.form)" within the <form> tag it doesn't work

Why not?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jbooth952 is offline Offline
4 posts
since Jun 2008
Jul 29th, 2008
0

Re: onSubmit vs onClick

Would have to see the form validation code to say.
Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007
Jul 29th, 2008
0

Re: onSubmit vs onClick

Change the onSubmit version to just onSubmit="return chkrange(this)" . Inside the form tag, this already refers to the form.
Reputation Points: 18
Solved Threads: 4
Light Poster
chaosprime is offline Offline
46 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: From underneath a rock....
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Public snippet: Web form autofocus





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC