24 Replies - 3877 Views - Last Post: 13 July 2010 - 01:16 PM
Posted 13 July 2010 - 06:40 AM
var dom = document.getElementById("myForm"); for (var i=0; i<dom.myCheckBox.length; i++)
the variable dom is a HTMLElement. by calling dom.myCheckBox you request the myCheckBox property, which of course doesn’t exist as myCheckBox is the ID of a nested form element, which doesn’t exist due to HTML restrictions (forms must not be nested).
This post has been edited by Dormilich: 13 July 2010 - 06:41 AM
Posted 13 July 2010 - 01:16 PM
you can also use the <fieldset> elements to set a border around certain input elements (which would make way more sense than using several form elements).
additional tip: use <label>s to label your elements. modern browsers jump to the according <input> when you click on its label.
This post has been edited by Dormilich: 13 July 2010 - 01:22 PM