onSubmit vs onClick

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2008
Posts: 4
Reputation: jbooth952 is an unknown quantity at this point 
Solved Threads: 0
jbooth952 jbooth952 is offline Offline
Newbie Poster

onSubmit vs onClick

 
0
  #1
Jul 29th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: onSubmit vs onClick

 
0
  #2
Jul 29th, 2008
Would have to see the form validation code to say.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 46
Reputation: chaosprime is an unknown quantity at this point 
Solved Threads: 4
chaosprime's Avatar
chaosprime chaosprime is offline Offline
Light Poster

Re: onSubmit vs onClick

 
0
  #3
Jul 29th, 2008
Change the onSubmit version to just onSubmit="return chkrange(this)" . Inside the form tag, this already refers to the form.
Chaos
Lost Souls: text based RPG
MUDseek: MUD gaming search
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC