Hi all,
I've got a spot of bother with my radiobuttonlist. It has 3 items in it and I want them to control the visibility of certain divs/tables.
But even simple text changes are becoming a headache and the postback is not firing the event I clicked on but the PREVIOUS event (ie, I click on value 1 and text shows nothing, I click on value 2 and text shows value 1, I click on value 3 and text shows value 2)...always 1 step behind.
Here's my code:
function SetMessageInTextbox() {
var rdolist_0 = document.getElementById("rdolist_0");
var rdolist_1 = document.getElementById("rdolist_1");
var rdolist_2 = document.getElementById("rdolist_2");
if (rdolist_0.checked)
document.getElementById("TextBox1").value="One";
if (rdolist_1.checked)
document.getElementById("TextBox1").value="Two";
if (rdolist_2.checked)
document.getElementById("TextBox1").value="Three";
}
I've tried combinations of adding attributes in the vb.net pageload function, the vb.net code behind rdoList.selectindexchange using
rdolist.Attributes.Add("onload", "javascript:SetMessageInTextbox()")
and also the onClick event of the HTML page.
If you can assist, please do.