hualing
asked on
How to make a check box disable?
<input type=checkbox name=mimi>
Can I make mimi disabled so that no one can uncheck it?
How can I accomplish this by Javascript?
Thanks
Can I make mimi disabled so that no one can uncheck it?
How can I accomplish this by Javascript?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear you,
You suggestion is work.
But now I want a button click to arouse the input checkbox disabled.
I tried this:
<input type=button nclick="document.forms[0]. mimi=this. blur();">
but failed.
I need a smooth code work well on both IE & NN
THANKS !
You suggestion is work.
But now I want a button click to arouse the input checkbox disabled.
I tried this:
<input type=button nclick="document.forms[0].
but failed.
I need a smooth code work well on both IE & NN
THANKS !
If you need it to be disabled when the page loads, you need to tell netscape it is:
<body onLoad="document.myForm.mi mi.disable d=true">
<FORM NAME="myForm">
<INPUT NAME="mimi" TYPE="checkbox" onClick="if (this.disabled) this.checked=false">
<INPUT TYPE="button" onClick="this.form.mimi.di sabled=tru e">
</FORM>
it will work in both browsers but be more visible in IE.
Michel
<body onLoad="document.myForm.mi
<FORM NAME="myForm">
<INPUT NAME="mimi" TYPE="checkbox" onClick="if (this.disabled) this.checked=false">
<INPUT TYPE="button" onClick="this.form.mimi.di
</FORM>
it will work in both browsers but be more visible in IE.
Michel
<INPUT NAME="mimi" TYPE="checkbox" disabled>
TYoung - that is how to initialise it in IE only and will disable it from the load of the page.
My script will disable the checkbox at will and work in Netscape too
Michel
My script will disable the checkbox at will and work in Netscape too
Michel
document.nameofmyform.mimi
.... and for Netscape, you must do this:
<INPUT type='checkbox' name='mimi' onFocus='this.blur();'>