I am having a hard time passing a var name to another var so i can use it throughout the site
im getting the original variable from a radio button, i want to take that var pass it to a $name and then use that $name anywhere on the site on any page.
<form name="radioemail">
<input type="radio" name="chkmailext" value=".com" onclick="getradioval()"
/>.com
<input type="radio" name="chkmailext" value=".net" onclick="getradioval()" />.net
<input type="radio" name="chkmailext" value=".org" onclick="getradioval()" />.org
<input type="radio" name="chkmailext" value=".biz" onclick="getradioval()" />.biz
<input type="radio" name="chkmailext" value=".ca" onclick="getradioval()" />.ca
</form>
Please select your proper email extension.<br />
Only those extensions listed will be accepted.
</div>
<script type="text/javascript">
function getradioval()
{
for (var i=0;i<document.radioemail.chkmailext.length;i++)
{
if (document.radioemail.chkmailext[i].checked)
{
var rbgroup = document.radioemail.chkmailext[i].value;
}
}
}
</script>
so from this rbgroup holds the value i want (and by the way that alert in this function does not work) i get a page error every time i click on the button..
anyway back to the var
so how do i pass rbgroup to a $name and use it anywhere in the site, i have tried putting $rbgroup, rbgroup, $name = rbgroup and i know that rbgroup has a value because i tested it. but nothing works no matter what i choose i cannot get the var to pass its info..
i guess what do i put after the function to get the val inside a $name so i can use it
it also tells me that my radio form is null and not an object, thats the page error i get
and i did change the form to read this
<form name="radioemail" action="" onsubmit="return getradioval()">]
but it still tells me that document.radioemail.chkmailext is null and is not an object