Link to home
Start Free TrialLog in
Avatar of Daniish
DaniishFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to add a tick-box to form which display an INPUT field when ticked?

Hello Gurus!

Please can you show me how i can add a tick-box to a form, which when ticked displays (or 'un-greys-out') an INPUT field.



Many thanks
Avatar of mankowitz
mankowitz
Flag of United States of America image

Use javascript, like this
<html>
<head>
</head>
<script>
function enable(){
document.forms[0].a.disabled = false;
}
</script>
<body>
<form>
<input type="checkbox" onclick="enable()">
<input name="a" type="text" disabled>
</form>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the grade, the points and the fun question.  I'm glad I could help.

bol