R
Randell D.
Folks,
I have a few <INPUT TYPE=TEXT> tags that are readonly if a specific
field has no value... these work fine. However, I also have checkboxes
which I would like to have as readonly, but the same code doesn't work -
Can someone suggest a solution?
This is sample code extracted from my original code:
// Before other input tags determine if they are read only or not,
// they check input tag sp6 has a value
<input name="sp6" type="text" id="sp6" size="8" maxlength="24">
// This works - input tag f6 is read only unless sp6 has a value
<input name="f6" type="text" id="f6" size="10" maxlength="24"
onFocus="if(sp6.value){f6.readOnly=false} else {f6.readOnly=true}">
// This does not work (checkbox tick on & off is always permitted
// regardless if sp6 has a value or not...
<input name="mon6" type="checkbox" id="mon6" value="1"
onFocus="if(sp6.value){mon6.readOnly=false} else {mon6.readOnly=true}">
I have tried onFocus, onChange and onBlur.
I am working on an intranet application built 100% for Mozilla browsers
if browser dependancy proves to be a problem.
All help, via the newsgroup so all can learn is greatly appreciated...
thanks
randelld
I have a few <INPUT TYPE=TEXT> tags that are readonly if a specific
field has no value... these work fine. However, I also have checkboxes
which I would like to have as readonly, but the same code doesn't work -
Can someone suggest a solution?
This is sample code extracted from my original code:
// Before other input tags determine if they are read only or not,
// they check input tag sp6 has a value
<input name="sp6" type="text" id="sp6" size="8" maxlength="24">
// This works - input tag f6 is read only unless sp6 has a value
<input name="f6" type="text" id="f6" size="10" maxlength="24"
onFocus="if(sp6.value){f6.readOnly=false} else {f6.readOnly=true}">
// This does not work (checkbox tick on & off is always permitted
// regardless if sp6 has a value or not...
<input name="mon6" type="checkbox" id="mon6" value="1"
onFocus="if(sp6.value){mon6.readOnly=false} else {mon6.readOnly=true}">
I have tried onFocus, onChange and onBlur.
I am working on an intranet application built 100% for Mozilla browsers
if browser dependancy proves to be a problem.
All help, via the newsgroup so all can learn is greatly appreciated...
thanks
randelld