Home All Groups Group Topic Archive Search About

radiobuttonlist not updating text

Author
16 Aug 2006 5:35 PM
Simon
I'm trying to change the text in a radio button list depending on the value
of a drop down selected.  The text won't change though.  I've even checked
the value of the item I wanted to change and it's correct, but the display is
still wrong.
I'm inserting the code at runtime via the
ClientScript.RegisterClientScriptBlock.
Here's my javascript code:
"function OnStateChanged()" +
            "{" +
                "var stateList =
document.getElementById(\"ctl00_MainContentHolder_wzdCustomWizard_ctl04_ddState\");" +
                "var state =
stateList.options[stateList.selectedIndex].text;" +
                "var rbToUpdate =
document.getElementById(\"ctl00_MainContentHolder_wzdCustomWizard_ctl04_rblAcctType_3\");" +
                "var newString = \"the state of \" + state + \" is
selected\";" +
                "rbToUpdate.value = newString;" +
            "}";

When I stick an alert in there after the update to check the value of
rbToUpdate, iit's correct, but it's still the old one on the page with the
blank in it.