Radio Button styling Script
I know I would need to mess with this part of the code, but I'm having difficulty getting it to work...
Code: Select all
function toggleRadiobox(rbObj,rbKey,rbGroup,rbId)
{
if (rbKey==0||rbKey==32){
var inputFields = document.getElementsByTagName("a");
for (var inputIndex=0;inputIndex<inputFields.length;inputIndex++)
{
if (inputFields[inputIndex].getAttribute("name")==rbGroup){
if(inputFields[inputIndex].className.indexOf("RadioboxChecked")<0)
{var RadioBoxType = inputFields[inputIndex].className.replace("RadioboxUnchecked","");}
else
{var RadioBoxType = inputFields[inputIndex].className.replace("RadioboxChecked","");}
inputFields[inputIndex].className="RadioboxUnchecked"+RadioBoxType;
}
}
var inputFields = document.getElementsByTagName("input");
for (var inputIndex=0;inputIndex<inputFields.length;inputIndex++)
{
if (inputFields[inputIndex].getAttribute("name")==rbGroup)
{
if (inputFields[inputIndex].getAttribute("id")==rbId)
{
if(rbObj.className.indexOf("RadioboxChecked")<0)
{var RadioBoxType = rbObj.className.replace("RadioboxUnchecked","");}
else
{var RadioBoxType = rbObj.className.replace("RadioboxChecked","");}
inputFields[inputIndex].checked = true;rbObj.className="RadioboxChecked"+RadioBoxType;}
else
{inputFields[inputIndex].checked = false;}
}
}
return false;
}
}Thanks for your help guys... any advice would be appreciated!