D
dighazuse
trying to get a javascript attached to a DataGrid RadioButtonList. I
have a similar thing working for a DDL so i copied that for the RBL.
It "errors" when i am trying to get the current selected value for the
RBL.
code in ItemDataBound:
rblDC.Attributes.Add("onClick", "rblDC_onClick('" + lblDC.ClientID +
"', '" + rblDCodes.ClientID + "', '" + e.Item.ItemType + "')");
Javascript:
function rblDC_onClick(lblDCId, rblDCId, eiT)
{
var lblDC = document.getElementById(lblDCId);
var rblDC = document.getElementById(rblDCId);
var rblDCSelection = rblDC.options[rblDC.selectedIndex].value); <--
JS error
if (lblDC.innerText == rblDCSelection)
"do stuff"
}
the error i get says:
"options" is null or is not an object.
which, to noob me, says that it doesn't have a valid rblDC. not sure
though. could be a syntax error of sorts.
thank you
troy
have a similar thing working for a DDL so i copied that for the RBL.
It "errors" when i am trying to get the current selected value for the
RBL.
code in ItemDataBound:
rblDC.Attributes.Add("onClick", "rblDC_onClick('" + lblDC.ClientID +
"', '" + rblDCodes.ClientID + "', '" + e.Item.ItemType + "')");
Javascript:
function rblDC_onClick(lblDCId, rblDCId, eiT)
{
var lblDC = document.getElementById(lblDCId);
var rblDC = document.getElementById(rblDCId);
var rblDCSelection = rblDC.options[rblDC.selectedIndex].value); <--
JS error
if (lblDC.innerText == rblDCSelection)
"do stuff"
}
the error i get says:
"options" is null or is not an object.
which, to noob me, says that it doesn't have a valid rblDC. not sure
though. could be a syntax error of sorts.
thank you
troy