Slim81
asked on
Disable textfield with checkbox
Hey guys and gals,
I am pretty new to javascript so please bear with me.
I have a checkbox that when clicked, I would like to disable a textfield.
Here is my function:
And here is my HTML:
Any ideas would be greatly appreciated!
Thanks,
Slim
I am pretty new to javascript so please bear with me.
I have a checkbox that when clicked, I would like to disable a textfield.
Here is my function:
<script type="text/javascript">
function disableForm()
{
if (document.getElementById("fShipping").checked)
{
document.getElementById("freeLimit").disabled=true;
}
}
</script>
And here is my HTML:
<p id="freeShipping">
<input name="fShipping" id="fShipping" type="checkbox" value="1" onFocus="disableForm()"/>
Free shippping on all orders over $
<input name="freeLimit" id="freelimit" type="text" size="6" maxlength="6" />
</p>
Any ideas would be greatly appreciated!
Thanks,
Slim
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!