Javascript works only in IE

A

Angelos

Why does this Script does not work in Firefox ?
I am trying to make a select deselect CHECKbox function with invert
selection capability...
But this script works only in IE :(

Any Help and Ideas ?

<SCRIPT LANGUAGE="JavaScript">

function un_check(){
for (var i = 0; i < list_content_frm.length; i++) {
var e = document.list_content_frm.elements;
if ((e.getAttribute("className") == "Rcheck"))
{
if ((e.getAttribute("className") == "Rcheck") && (e.checked == true))
{
e.checked = false;
}
else
{
e.checked = true;
}
}
}
}
</SCRIPT>

Thanks for that !!!
 
L

Lasse Reichstein Nielsen

....
But this script works only in IE :(
<SCRIPT LANGUAGE="JavaScript">

function un_check(){
for (var i = 0; i < list_content_frm.length; i++) {

Where is the global variable "list_content_frm" declared? See:
<URL:http://jibbering.com/faq/#FAQ4_41>

Try :
function toggleChecks() {
var elems = document.forms['list_content_frm'].elements;
for (var i = 0; i < elems.length; i++) {
var e = elems;
if (e.className == "Rcheck") {
e.checked = ! e.checked;
}
}
}
/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top