[Javascript] IE onclick problem

tedd tedd at sperling.com
Fri Apr 18 12:48:47 CDT 2008


At 8:40 AM -0700 4/17/08, Howard Jess wrote:
>And finally, it's *far* better to leave this attribute out of
>markup altogether, and do everything in javascript:
>
>     <form id="someform"> .... </form>
>
>     <script type="text/javascript">
>     window.onload=function() {
>       var form=document.getElementById('someform');
>       if (form) form.onsubmit = checkMyForm;
>     }
>     </script>

Howard:

I spoke too soon -- take a look at this:

http://webbytedd.com/ccc/test-onsubmit1/index.php

Please note that while not entering the data required in each text 
box will generate an alert, it will not stop the submit.

I provided a demo here:

http://webbytedd.com/ccc/test-onsubmit/index.php

The proper operation is to prohibit a submit until both text boxes have data.

So, how do you do that while remaining unobtrusive?

Cheers,

tedd

-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list