rade
11-09-2006, 10:54 AM
Hey. Okay this is my problem,
I've made a simple HTML form (see the picutre).
I need all the other fields than the first four (YES/NO questions) to be disabled (so you can't write in them).
When the user has answered the first four questions correctly the rest of the form would become enabled.
To put it in other words:
a) Only the first four questions are enbled. Everything else is disabled.
b) When the user has answered YES, NO, YES, YES on the four questions the rest of the form becomes enabled.
Uh, hope you got my point. Any suggestions? I'd like to do this (function) with Javascript. Thanks!
Form code (with some table tags stripped):
<p>Question 1<br />YES<input name="one" type="radio" value="yes" /> NO<input name="one" type="radio" value="no" /></p>
<p>Question 2<br />YES<input name="two" type="radio" value="yes" /> NO<input name="two" type="radio" value="no" /></p>
<p>Question 3<br />YES<input name="three" type="radio" value="yes" /> NO<input name="three" type="radio" value="no" /></p>
<p>Question 4<br />YES<input name="four" type="radio" value="yes" /> NO<input name="four" type="radio" value="no" /></p>
<p>Modify this text<br /><textarea name="textarea1" cols="30" rows="7"></textarea></p>
<p>Modify this text<br /><textarea name="textarea2" cols="30" rows="7"></textarea>
</p><p>Full name<br /><input name="realname" type="text" value="" size="25" maxlength="100" /></p>
<p>E-mail<br />
<input name="email" type="text" value="" size="25" maxlength="100" /></p>
<p>Phone<br /><input name="phone" type="text" value="" size="25" maxlength="100" /></p>
<p><input name="submit" type="submit" value="Submit" /> <input name="reset" type="reset" value="Reset" /></p>
I've made a simple HTML form (see the picutre).
I need all the other fields than the first four (YES/NO questions) to be disabled (so you can't write in them).
When the user has answered the first four questions correctly the rest of the form would become enabled.
To put it in other words:
a) Only the first four questions are enbled. Everything else is disabled.
b) When the user has answered YES, NO, YES, YES on the four questions the rest of the form becomes enabled.
Uh, hope you got my point. Any suggestions? I'd like to do this (function) with Javascript. Thanks!
Form code (with some table tags stripped):
<p>Question 1<br />YES<input name="one" type="radio" value="yes" /> NO<input name="one" type="radio" value="no" /></p>
<p>Question 2<br />YES<input name="two" type="radio" value="yes" /> NO<input name="two" type="radio" value="no" /></p>
<p>Question 3<br />YES<input name="three" type="radio" value="yes" /> NO<input name="three" type="radio" value="no" /></p>
<p>Question 4<br />YES<input name="four" type="radio" value="yes" /> NO<input name="four" type="radio" value="no" /></p>
<p>Modify this text<br /><textarea name="textarea1" cols="30" rows="7"></textarea></p>
<p>Modify this text<br /><textarea name="textarea2" cols="30" rows="7"></textarea>
</p><p>Full name<br /><input name="realname" type="text" value="" size="25" maxlength="100" /></p>
<p>E-mail<br />
<input name="email" type="text" value="" size="25" maxlength="100" /></p>
<p>Phone<br /><input name="phone" type="text" value="" size="25" maxlength="100" /></p>
<p><input name="submit" type="submit" value="Submit" /> <input name="reset" type="reset" value="Reset" /></p>