Agree Before Entry

[Total: 0    Average: 0/5]

JavaScript will only let you enter your name in this form if you indicate you agree.

Head Code:

<!-- Begin

agree = 0;  // 0 means 'no', 1 means 'yes'

//  End -->

Body Code:

<form name=enableform onsubmit="alert('your ok then');">
You can only enter your name if you agree to the terms. (just a demo)<br>
<input type=radio name='enable' value='agree' onClick="agree=1;;">I agree<br>
<input type=radio name='enable' value='disagree' onClick="agree=0;'';">I disagree<br>

Please enter your name:  

<input type=text name=box onFocus="if (!agree)this.blur();" onChange="if (!agree)this.value='';" size=12>
<input type=submit value="Done!">

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *