Can somebody help me. I'm trying to set a disabled option to enabled when the user click on a link. I've tried just about everything and I'm practically pulling my hair out.
The option I want to enable is a test box.
The code to enable it calls a function.
The function is:
I've also tried using a getElementById in the onclick and tried using document.form.. . in the onclick and just can't seem to get the textbox to enable. Am I missing something really simple?
The option I want to enable is a test box.
Code:
<input type="text" name="input_name<?=$i;?>" id="input_id<?=$i;?>" value="<?=$class->value;?>" disabled="true" size="4"/>
Code:
<img alt="" src="images/img.gif" onclick="disable_enable(<?=$i;?>);"/>
Code:
<script type="text/javascript" language="JavaScript">
function disable_enable($i)
{
elements="input_name"+$i;
document.form.elements.disabled=false;
}
</script>
Comment