Tony R wrote:
I'm sorry that this reply is extremely n00bish, because I really should
know this stuff, but I haven't done JScript in so long that I've
forgotten a lot of the basics....
How do I define obj as my submit box?
Rather than hiding/showing the submit button, you are better to
disable/enable it. You also need script to disable it in the first
place and also to make sure its state reflects that of the checkbox if
the form is reset. Below is a bit of play code to get you started.
Note that if you check the checkbox the button is enabled, if you
re-load the page most browsers will keep the checkbox checked but the
submit button is disabled. Similarly, resetting the form will make the
checkbox unchecked but not disable the button again (hiding/showing has
exactly the same issues).
<form action="">
<input type="checkbox" onclick="
this.form.theSubmit.disabled = !(this.checked);
">Check me to enable the submit button<br>
<input type="submit" name="theSubmit" disabled>
</form>
PS. Don't give the submit button a name or ID of 'submit'.
--
Rob