Hi,
I wrote a small piece of javascript a while ago to add some text to a text box and mark it as read only if a check box was checked. If the checkbox was unchecked, the text would be removed and the field writable.
It was working great until I accadently deleted the file and had to start over from an old backup that didn't have the new functionality.. Now I have it so if you check the box, it puts the correct text, and marks the field read only, hoverer now I can't uncheck the checkbox.
Here is what I have this far:
javascript
<script type="text/javascript">
function disabler()
{
if (document.forms[0].micro.checked = true){
document.forms[0].status.value='...some text...';
document.forms[0].status.readOnly = true;
} else if (document.forms[0].micro.checked = false){
document.forms[0].status.value='';
document.forms[0].status.readOnly = false;
}
}
</script>
HTML
shipping/tracking number:<input type='text' name='status' id='status'> (<input type='checkbox' name='micro' id='micro' onchange='disabler()'> : Micro Note)
thanks for any help!