MrCraig
18-12-2007, 07:15 PM
Ok,
Im learning more javascript and so far, I can do most things, but only to do them in the onclick attribute using 'this'
Say i wanted a button that would enable fields in a form using a function, how would i do this?
For example
<head>
<script type="text/javascript">
function enable()
{
document.form1.field1.disabled = 'false';
document.form1.field2.disabled = 'false';
}
</script>
</head>
<body>
<form name="form1">
<input type="text" disabled="disabled" name="field1" />
<input type="text" disabled="disabled" name="field2" />
<input type="button" onclick="enable()" />
</form>
</body>
Thanks for any help :)
Im learning more javascript and so far, I can do most things, but only to do them in the onclick attribute using 'this'
Say i wanted a button that would enable fields in a form using a function, how would i do this?
For example
<head>
<script type="text/javascript">
function enable()
{
document.form1.field1.disabled = 'false';
document.form1.field2.disabled = 'false';
}
</script>
</head>
<body>
<form name="form1">
<input type="text" disabled="disabled" name="field1" />
<input type="text" disabled="disabled" name="field2" />
<input type="button" onclick="enable()" />
</form>
</body>
Thanks for any help :)