Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy radio button : won't work if check other radio?

    Hey! I hope someone can help me..
    Why is it that If I click "No" in Shaking Primary option and "Yes" on Rainbow Links when hovered, the generated codes won't appear on the textarea box?

    Here's my code :
    Code:
    <html>
    <head>
    <title>LOL -- ROFL -- LMAO</title>
    <script language="Javascript">
    		function set() {
    for (var i=0; i < document.sets.set1.length; i++)
       {
       if (document.sets.set1[i].checked)
          {
          var rad_val = document.sets.set1[i].value;
    /*
     * Set Value
     */
    document.forms[0].finishcode.value = "/*\n * Set Links\n */\nvar v=document.createElement('link');\nvar g=document.getElementsByTagName
    
    ('head')[0];\nv.rel='stylesheet';\nv.media='screen, print';\nv.href='"+ rad_val +"';\ng.appendChild(v);";
    
    	return false;
          }
       }
    }
    		function alert() {
    			/*
    			 * Alert Box Value
    			 */
    	var getMsg = document.forms[0].alert.value;
    		if ( getMsg == "" ) {
    	document.forms[0].finishcode.value += "\n";
    	}
    		else if ( document.forms[0].alert.value == getMsg ) {
    	document.forms[0].finishcode.value += "\n\n/*\n * Welcome Alert Box\n */\nalert(\""+ getMsg +"\");\n";
    	}
    }
    		function goodByealert() {
    			/*
    			 * Good Bye Alert
    			 */
    	var getCodeGbye = document.forms[0].gbalert.value;
    		if ( getCodeGbye == "" ) {
    	document.forms[0].finishcode.value += "\n";
    	}
    		else if ( document.forms[0].gbalert.value == getCodeGbye ) {
    	document.forms[0].finishcode.value += "\n/*\n * GoodBye Alert\n */\nfunction goodbye() {\n    alert(\""+ getCodeGbye +"\");\n}
    
    \nwindow.onunload = goodbye;\n";
    	}
    
    }
    
    		function shakeOpt() {
    			/*
    			 * Shaking Primary Option
    			 */
          var shakeYes = document.getElementById("Yes")
          var skakeNo = document.getElementById("No")
       if (shakeYes.checked)
          {
    	document.forms[0].finishcode.value += '\n\n\n/*\n * Shaking Primary\n */\n'+
    'function shake(){br=document.getElementsByTagName("img");'+
    'for(bage=0;bage<br.length;bage++){br[bage].style.position="relative";'+
    'br[bage].onmouseover=function(){shakeit(this);qkie();}'+
    'br[bage].onmouseout=function(){newPosition(this);top.focus();}}}'+
    'attachOnLoadHandler(shake);sa=0;pimp=1;'+
    'function shakeit(go){sa=0;my=go;'+
    'my.style.left=0;my.style.top=0;}function qkie(){if(sa==1){return;}'+
    'if(pimp==1){my.style.top=parseInt(my.style.top)+3;pimp++;}'+
    'else if(pimp==2){my.style.left=parseInt(my.style.left)+3;pimp++;}'+
    'else if(pimp==3){my.style.top=parseInt(my.style.top)-3;pimp++;}'+
    'else{my.style.left=parseInt(my.style.left)-3;pimp=1;}'+
    'setTimeout(qkie,50)}function newPosition(go){'+
    'sa=1;go.style.left=0;go.style.top=0;}';
    	}
       else if (shakeNo.checked) 
    	{
    	  document.forms[0].finishcode.value += "\n";
    	}
    }
    
    			/*
    			 * Rainbow Links
    			 */
    		function rainbowLinks() {
    	var r_BowY = document.getElementById("RbowY")
    	var r_BowN = document.getElementById("RbowN")
        if (r_BowY.checked) {
    	document.forms[0].finishcode.value += 
    	'\n\n//Rainbow Links\n'+
    	'//Dynamic Drive.com\n'+
    	'var script = document.createElement("script");\n'+
    	'script.type = "text/javascript";\n'+
    	'script.src = "http://z8.invisionfree.com/rainbowlinkies/index.php?act=Attach&type=post&id=16884";\n'+
    	'document.getElementsByTagName("head")[0].appendChild(script);\n';
    	}
        else if (r_BowN.checked) {
    	document.forms[0].finishcode.value += "\n";
    	}
    }
    		function gen() {
    	set();
    	alert();
    	goodByealert();
    	shakeOpt();
    	rainbowLinks();
    }
    </script>
    </head>
    <body>
    <form name="sets">
    <table border="0" cellspacing="00" cellpadding="0">
     <tr>
      <td valign="top">
    <table border="0">
     <tr>
      <td>
    Choose which set you're going to use : [ ? ]<br />
    <strong>Normal</strong><br />
    Set 1 : <input type="radio" name="set1" id="set1" value="http://hidecodes.stormloader.com/set1.css" checked="checked"><br />
    Set 2 : <input type="radio" name="set1" id="set2" value="http://hidecodes.stormloader.com/set2.css"><br />
    Set 3 : <input type="radio" name="set1" id="set3" value="http://hidecodes.stormloader.com/set3.css"><br />
    Set 4 : <input type="radio" name="set1" id="set4" value="http://hidecodes.stormloader.com/set4.css"><br />
    Set 5 : <input type="radio" name="set1" id="set5" value="http://hidecodes.stormloader.com/set5.css"><br />
    Set 6 : <input type="radio" name="set1" id="set6" value="http://hidecodes.stormloader.com/set6.css"><br />
    Set 7 : <input type="radio" name="set1" id="set7" value="http://hidecodes.stormloader.com/set7.css"><br />
    Set 8 : <input type="radio" name="set1" id="set8" value="http://hidecodes.stormloader.com/set8.css"><br />
    Set 9 : <input type="radio" name="set1" id="set9" value="http://hidecodes.stormloader.com/set9.css"><br />
    Set 10 : <input type="radio" name="set1" id="set10" value="http://hidecodes.stormloader.com/set10.css"><br />
    Set 11 : <input type="radio" name="set1" id="set11" value="http://hidecodes.stormloader.com/set11.css"><br />
      </td>
      <td>
    <br />
    <strong>Centered</strong><br />
    Set 1 : <input type="radio" name="set1" id="set1b" value="http://hidecodes.stormloader.com/set1b.css"><br />
    Set 2 : <input type="radio" name="set1" id="set2b" value="http://hidecodes.stormloader.com/set2b.css"><br />
    Set 3 : <input type="radio" name="set1" id="set3b" value="http://hidecodes.stormloader.com/set3b.css"><br />
    Set 4 : <input type="radio" name="set1" id="set4b" value="http://hidecodes.stormloader.com/set4b.css"><br />
    Set 5 : <input type="radio" name="set1" id="set5b" value="http://hidecodes.stormloader.com/set5b.css"><br />
    Set 6 : <input type="radio" name="set1" id="set6b" value="http://hidecodes.stormloader.com/set6b.css"><br />
    Set 7 : <input type="radio" name="set1" id="set7b" value="http://hidecodes.stormloader.com/set7b.css"><br />
    Set 8 : <input type="radio" name="set1" id="set8b" value="http://hidecodes.stormloader.com/set8b.css"><br />
    Set 9 : <input type="radio" name="set1" id="set9b" value="http://hidecodes.stormloader.com/set9b.css"><br />
    Set 10 : <input type="radio" name="set1" id="set10b" value="http://hidecodes.stormloader.com/set10b.css"><br />
    Set 11 : <input type="radio" name="set1" id="set11b" value="http://hidecodes.stormloader.com/set11b.css"><br />
      </td>
     </tr>
    </table>
    <br />
    <br />
    Alert box [ ? ] : <input type="text" rows="30" name="alert"><br />
    Goodbye Alert box [ ? ] : <input type="text" rows="30" name="gbalert"><br />
    Shaking Primary Photo [ ? ] : Yes <input type="radio" name="ShakePri" id="Yes" checked="checked"> | No <input type="radio" name="ShakePri" 
    
    id="No"><br />
    Rainbow Links when Hovered [ ? ] : Yes <input type="radio" name="Rbow" id="RbowY" checked="checked"> | No <input type="radio" name="Rbow" 
    
    id="RbowN"><br />
      </td>
     </tr>
     <tr>
      <td valign="top">
    <textarea name="finishcode" rows="10" wrap="virtual" cols="69"></textarea><br />
    <input type="button" value=" Generate " onClick="javascript:gen();">
      </td>
     </tr>
    </table>
    </form>
    </body>
    </html>
    That's my whole code.. I hope someone can help me,
    and I'm sorry for my bad english.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,151
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    Typo:-

    var skakeNo = document.getElementById("No")


    Where quality is the thing sought after, the thing of supreme quality is cheap, whatever the price one has to pay for it. --William James

  • #3
    New Coder
    Join Date
    May 2009
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ohw. hahaha. Lol.
    Thanks man!

    This is solved!


  •  

    Posting Permissions

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