...

View Full Version : radio button : won't work if check other radio?



flint0131
05-22-2009, 05:48 PM
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 :


<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. :rolleyes:

Philip M
05-22-2009, 06:45 PM
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

flint0131
05-23-2009, 05:16 AM
Ohw. hahaha. Lol.
Thanks man! :thumbsup:

This is solved! :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum