facebook twitter youtube
in JavaScripts - 18 Oct, 2011, This Tutorial Has Been Viewed 14,311 Times.
by admin - no comments
Agree Before Entry Using Javascript
VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

Agree before entry using Javascript,with button disable functionality,that means if you agree, you can enter your name. But, if you disagree, you will not be able to enter or edit your name. When you disagree, the box is ‘locked.’ Useful if you require your visitors to accept a disclaimer before downloading software or visiting a section of your members-only site.

<head>
<script LANGUAGE="JavaScript">
agree = 0;  // 0 means 'no', 1 means 'yes'
</script>
</head>
<form name=agree_form>
You can only enter your name if you agree to the terms. (just a demo)<br />
<br />
<input type=radio name='enable' value='I agree with Terms & Conditions' onClick="agree=1; document.agree_form.box.focus();document.getElementById('subm').disabled = false"/>I agree with Terms & Conditions<br />
<input type=radio name='enable' value='I disagree with Terms & Conditions' onClick="agree=0; document.agree_form.box.value='';document.getElementById('subm').disabled = true;
"/>I disagree with Terms & Conditions<br />
Please enter your name:
<input type=text name=box onFocus="if (!agree)this.blur();" onChange="if (!agree)this.value='';" size=12/>
<br />
<br />
<input type=submit id="subm" value="Done"/>
</form>

DEMO

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
Agree Before Entry Using Javascript, 10.0 out of 10 based on 1 rating

Incoming search terms:




coded by nessus

Leave a Reply

Close
Please support the site
By clicking any of these buttons you help our site to get better