[Javascript] IE onclick problem
tedd
tedd at sperling.com
Mon Apr 21 13:20:26 CDT 2008
At 8:54 AM -0700 4/21/08, Howard Jess wrote:
>I think it's time for you to get and read a good book on JavaScript,
>where most
>of your questions will likely be answered; specifically, anonymous functions
>(lambdas) and closures. I'd suggest Flanagan's
>_JavaScript_The_Definitive_Guide_.
>
>In short,
>
> window.onload=function() {
> var form1 = document.getElementById('a');
> var form2 = document.getElementById('b');
> form1.onsubmit = function() {
> return checkform(form1);
> }
> form2.onsubmit = function() {
> return checkform(form2);
> }
> }
>
>Or, as David Hucklesby implied, use DOM2 events:
>
> form1.addEventListener('submit',formcheck,false);
> form2.addEventListener('submit',formcheck,false);
Ahhh, you are right of course. I don't know why I didn't see that.
Thanks for the education.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
More information about the Javascript
mailing list