I've found a different solution to get me where I need to be, but this problem is still plaguing me. I have a checkbox that I want to flip between disabled and enabled, but I can't do it in the code behind, and there will be no post back between the time that I need the state to change.
The thing is, I've been all over the net and I've seen dozens of posts of people w/this same problem who all seem to get it to work. I've used their code and still can't get it to work.
So here's what I have for very very basic code:
function flipCB(cbID, state)
var cb = document.getElementById(cbID);
if(cb != null)
cb.disabled = state;
alert(cb.disabled + "; should be = " + state);
<input type="checkbox" id="cb1" /><br /><br />
<input type="button" value="HideCb" onClick="flipCB('cb1', 'true');" />
<input type="button" value="ShowCb" onClick="flipCB('cb1', 'false');" />
I can get the HideCb to disable the checkbox, but I cannot get the ShowCb to enable it! The alert confirms that the code is executing in the correct path, but it just doesn't seem to affect it at all.
I've tried this is FF3 and IE7.
If someone can point out why I'm a moron, it would help me sleep tonight lol .
EDIT: and yes, I used the search feature here, but did not find anyone who hadn't solved the problem with code that worked for me.