SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Canada
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Agreement button

    I was wondering how I could make it so dialog shows for an agreement of the use of the website and have a radio button for when you press yes the continue button lights up. If you need more description please ask.

  2. #2
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there is a script for this i think
    on www.dynamicdrive.com

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Canada
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks
    http://www.stupidflash.com (warning not for the week minded)

  4. #4
    SitePoint Addict picasso-trigger's Avatar
    Join Date
    Dec 2003
    Location
    somewhere out there
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did you find one? share it when you do!

    thanks
    _________________________

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>* Licence Agreement *</title>
    <style type="text/css">
    
    form     {
              width: 600px;
              margin: 40px auto;
              text-align: center;
             }
    td       {
              color: #fff;
             }
    fieldset {
              margin: 0;
              border: 1px solid #fff;
             }
    legend   {
              background: thistle;
              border: black 1pt solid;
              padding-left: 1em;
              padding-right: 1em;
             }
    textarea {
              margin: 12px;
              font: normal 12px verdana, sans-serif;
              padding: 5px;
             }
    
    </style>
    </head>
    <body style="background:#000;">
    <form>
    <fieldset>
    <legend>Licence Agreement</legend>
    <table>
    <tr>
    <td>
    <textarea cols="82" rows="14" readonly="readonly">
    This agreement covers all code, comment, graphics, and any other contents of this website.
    
    The site owner is not liable for any damage to hardware or loss of hearing through the use of any of the features of this site.
    
    The licensee will not reverse engineer or manipulate the code in any manner in order to disable or enhance any functionality.
    
    The licensee is not entitled to distribute the content in any manner except for use on the licensee's computers and those of his employees. Any violation of this agreement will result in immediate termination of the contract and the loss of the licensee's first born.
    </textarea></td>
    </tr><tr>
    <td><strong>I have read and accept this agreement.</strong>&nbsp; 
    <input name="agree" type="radio" onclick="go.disabled=false">Yes&nbsp; &nbsp; 
    <input name="agree" type="radio" checked="checked" onclick="go.disabled=true">No&nbsp; &nbsp; 
    <input name="go" type="button" value="Continue" disabled="disabled" onclick="self.location='enter.html'">
    <br /><br />
    </td>
    </tr>
    </table>
    </fieldset>
    </form>
    <script type="text/javascript">
    onload = function() {document.forms[0].agree[1].checked = true;}
    </script>
    </body>
    </html>
    ::: certified wild guess :::

  6. #6
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,479
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    or try this:-

    Code:
    <html>
    <head>
    <title>* Licence Agreement *</title>
    <style type="text/css">
    
    form	 {
    		  width: 600px;
    		  margin: 40px auto;
    		  text-align: center;
    		 }
    td	   {
    		  color: #fff;
    		 }
    fieldset {
    		  margin: 0;
    		  border: 1px solid #fff;
    		 }
    legend   {
    		  background: thistle;
    		  border: black 1pt solid;
    		  padding-left: 1em;
    		  padding-right: 1em;
    		 }
    textarea {
    		  margin: 12px;
    		  font: normal 12px verdana, sans-serif;
    		  padding: 5px;
    		 }
    
    </style>
    </head>
    <body style="background:#000;">
    <form name="form1">
    <fieldset>
    <legend>Licence Agreement</legend>
    <table>
    <tr>
    <td>
    <textarea cols="82" rows="14" readonly="readonly">
    This agreement covers all code, comment, graphics, and any other contents of this website.
    
    The site owner is not liable for any damage to hardware or loss of hearing through the use of any of the features of this site.
    
    The licensee will not reverse engineer or manipulate the code in any manner in order to disable or enhance any functionality.
    
    The licensee is not entitled to distribute the content in any manner except for use on the licensee's computers and those of his employees. Any violation of this agreement will result in immediate termination of the contract and the loss of the licensee's first born.
    </textarea></td>
    </tr><tr>
    <td><strong>I have read and accept this agreement.</strong>&nbsp; 
    <input name="agree" type="checkbox" onclick="javascript:chkAgree();">Yes&nbsp; &nbsp; 
    <input name="go" type="submit" value="Continue" disabled="disabled">
    <br /><br />
    </td>
    </tr>
    </table>
    </fieldset>
    </form>
    <script language="javascript">
    function chkAgree(){
    if(!document.form1.agree.checked){
    document.form1.go.disabled = true;
    }else{
    document.form1.go.disabled = false;
    }
    }
    </script>
    </body>
    </html>
    The code above uses a checkbox instead of 2 radio buttons. So, from the code posted by adios, I changed the following code

    Code:
    <input name="agree" type="radio" onclick="go.disabled=false">Yes&nbsp; &nbsp; 
    <input name="agree" type="radio" checked="checked" onclick="go.disabled=true">No&nbsp; &nbsp; 
    <input name="go" type="button" value="Continue" disabled="disabled" onclick="self.location='enter.html'">
    <br /><br />
    </td>
    </tr>
    </table>
    </fieldset>
    </form>
    <script type="text/javascript">
    onload = function() {document.forms[0].agree[1].checked = true;}
    </script>

    to

    Code:
    <input name="agree" type="checkbox" onclick="javascript:chkAgree();">Yes&nbsp; &nbsp; 
    <input name="go" type="submit" value="Continue" disabled="disabled">
    <br /><br />
    </td>
    </tr>
    </table>
    </fieldset>
    </form>
    <script language="javascript">
    function chkAgree(){
    if(!document.form1.agree.checked){
    document.form1.go.disabled = true;
    }else{
    document.form1.go.disabled = false;
    }
    }
    </script>
    and specified the name of the form as form1, so instead of

    Code:
    <form>
    it looks like
    Code:
    <form name="form1">
    Works fine all the same but normally there's a checkbox which user muct check to proceed, instead of 2 radio buttons. But each to his own liking. You have both scripts now, with radio buttons & with checkbox.

    Use whatever you want.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •