I tested your code with a minor change from "forms[1]" to "forms[0]" and it appears to work.
Man do I feel like a dummy.
I name of form changed.
Once I set the javascript to point to document.formname.... everything started working.
BTW, if you only have one form on the page then yes the [0] would be correct.
I was referencing the second form on the page, thus the form[1]. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
One other thing, I wrote a nifty widget that allows you to toggle fieldsets with specified enablers. As long as you use the right class names etc. you'd be good to go (I wrote this about a year ago, so there's definitely a more efficient way to do this now):
Granted, you'll need these helper functions:
if (e.originalTarget)
return e.originalTarget;
else if (e.srcElement)
return e.srcElement;
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload =
function() {
oldonload();
func();
}
}
}
Array.prototype.inArray = function (value) {
var i;
for (i=0; i < this.length; i++) {
if (this[i] == value)
return true;
}
return false;
};
Of course without a working demo for you to see this, I can see how it's easy to get lost. I'll get a working demo of this on my site soon enough to help give you a visual.
Ok I know this just HAS to be easy and I'm missing it due to my lack of javascript knowledge.
Thus I'm asking the oh great javascript guru's of CWM.
** How's that for some brown nosing.
/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> **
To the problem:
I've got some radio buttons in a grid.
What I want to happen is when one is selected a group of others is selected.
The javascript I have to do this is:
document.forms[1].mornM.checked = true;
document.forms[1].dayM.checked = true;
document.forms[1].nightM.checked = true;
}
I have this function triggered here:
It appears to work behind the scenes in both IE6 and FF.
Unfortunately, the visual status of the check boxes listed in the javascript are not showing to be checked.
I've been banging my head against this all morning but can not figure it out.
/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" />
What am I missing oh great gurus?
/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
http://www.halois.net