Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

  Accept Disclaimer Radio Button Example JavaScript

Confirm your visitor's approval by requiring their name before continuing on. Useful if you require your visitors to accept a disclaimer before downloading software or visiting a section of your members-only site. Could be used with a cookie.
Cut & Paste Script

<html>
<head>
<title>Radio Button Example</title>
<script>
var agree=0;  // 0 = 'no', 1 = 'yes'

function agree2() {
  if (!document.getElementById) return false;
  agree=1;
  document.getElementById('box').style.background='#fff000';
  if (agree) {
    document.getElementById('enterName').style.visibility = 'visible';
  }
  document.enableform.box.focus();
}

function disagree() {
  if (!document.getElementById) return false;
  agree=0;
  if (!agree) {
    document.getElementById('enterName').style.visibility = 'hidden';
  }
  document.enableform.done.focus();
}

function goSubmit() {
  if (agree==0) {
    alert("DISGREE: You can insert the next step here");
  } else if (agree==1 && document.enableform.box.value=='') {
      alert("You must enter your name!");
      document.enableform.box.focus();
  } else {
    alert("AGREE: You can insert the next step here");
  }
}

</script>
<style>
#enterName {
  visibility: hidden;
  padding-left: 50px;
}
</style>
</head>
<body>

Accept Disclaimer Radio Button Example JavaScript

<form name="enableform">
  <input type="radio" name="enable" value="agree" onclick="agree2();">I agree
  <div id="enterName">Please enter your name to show agreement: <input type=text id="box" name="box"></div>
  <input type="radio" name="enable" value="disagree" onclick="disagree();">I disagree
  <br><br>
  <input type="button" value="Done!" name="done" onclick="goSubmit()">
</form>


</body>
</html>

 
   
     RELATED SCRIPTS
 
JavaScript Sequential fly-in text script
This script flies in multiple text from the left edge of the window, one at a time in sequential order similar to a PowerPoint effect. It's versatile enough to handle any number of text (or other rich HTML like images!), and you can customize both the animation speed and pause between each messa...more »
Category : JavaScript Examples Hits : 491
   
Toggle a DIV using JavaScript
Here is a javascript function to toggle a div object. Once you click the Show/Hide link, the Div object will become invisible. It will become visible by clicking the Show/Hide link again....more »
Category : JavaScript Examples Hits : 456
   
Creating a Popup Once Window using JavaScript
Popup windows are everywhere on the web. Use this script to add one to your site that is NOT annoying, since it only pops up once. Try leaving then coming back to this page- no more popup. ...more »
Category : JavaScript Examples Hits : 323
   
Counting characters in textarea using javascript
Here is a javascript code for counting the characters in a textarea....more »
Category : JavaScript Examples Hits : 432
   
Drop Down World Clock Using JavaScript
Look up the time of various cities around the world easily with this useful script! Configurable to use cities of your choice....more »
Category : JavaScript Examples Hits : 455
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download Cracking The Niche Code Ebook Cracking The Niche Code
   
Download 	C Elements of Style Ebook C Elements of Style
   
Download 5 Simple Ways To Boost Up Your Website Ebook 5 Simple Ways To Boost Up Your Website
   
Download Protect Your Computer System Ebook Protect Your Computer System
   
Download PHP 5 Power Programming  Ebook PHP 5 Power Programming
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz