I need help in the placement of the script below. I know absolutely nothing about javascript, so please explain in simple and easy to understand language where this would be place. <BODY OnLoad="clearAll()";> <FORM NAME=form1 METHOD=POST ACTION="http://www.my domainname.com/cgi-bin/cart.pl"> ... </FORM> <SCRIPT LANGUAGE="JavaScript"> function clearAll() { document.form1.multi-item1.checked = false; document.form1.multi-item2.checked = false; document.form1.multi-item3.checked = false; } </SCRIPT>
uhhh, it should be between the header tags. also the 'language' property is depreciated in favor of 'type'. example... <!DOCTYPE......> <html> <head> <title>my website</title> <meta...../> <script type="text/javascript"> function clear_all() { document.form1.multi-item1.checked = false; // assuming that this is correct document.form1.multi-item2.checked = false; document.form1.multi-item3.checked = false; } </script> </head> <body onload="clear_all();"> <form action.....> <input...... /> </form> </body> </html> Code (markup): hope this helps you out some. for further reading, please see w3schools.com/jsref/
Hmm.. It think its ok if you place it in the body section also. And ansi is right about the language attribute. You should use the type attribute. ~ Thomas