[Javascript] Firefox issue with checkbox selection

David Dorward david at dorward.me.uk
Wed Mar 14 03:59:56 CDT 2007


Alan Easton wrote:

> 1) The case sensitive issue for getElementById
> 
> 2) Using a submit form button, instead of a link.
> 
> I changed my code to do this, and it works in IE and Firefox. I did not 
> change the function to use getElementById, but changed the function call 
> from a link, to a input button, and it worked.
> 

>   if (eval("document.mylist.propID[" + i + "].checked") == true)

Eeep! Rule of thumb, if you're using eval, then you're probably doing 
something wrong.

    if (document.mylist.propID[i].checked) == true)

> <input type="button" value="DELETE" onClick="DeleteProperties(this.form)">

That isn't a submit button, nor is it an onsubmit event.

<form ... onsubmit="return someFunction()">
   <input type="submit">
</form>

function someFunction() {
	if (doNotSendFormCondition) {
		return false;
	} else {
		return true;
	}
}
-- 
David Dorward                               <http://dorward.me.uk/>



More information about the Javascript mailing list