A
Alex
Hello, all.
Big question (for my very limited knowledge) - What's wrong with
this ? No error, but nothing happens:
HTML......................
<head runat="server">
<title>Test Page</title>
<script>
function radioButtonList2Click()
{
document.form1.radioButtonList1.SelectedIndex = -1;
}
</script>
<script>
function radioButtonList1Click()
{
document.form1.radioButtonList2.SelectedIndex = -1;
}
</script>
</head>
and
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (radioButtonList1.Attributes["OnSelectedIndexChanged"] == null)
{
radioButtonList1.Attributes.Add("OnSelectedIndexChanged",
"javascript:radioButtonList1Click()");
}
if (radioButtonList2.Attributes["OnSelectedIndexChanged"] == null)
{
radioButtonList2.Attributes.Add("OnSelectedIndexChanged",
"javascript:radioButtonList2Click()");
}
}
}
Thanks a lot
Alex
Big question (for my very limited knowledge) - What's wrong with
this ? No error, but nothing happens:
HTML......................
<head runat="server">
<title>Test Page</title>
<script>
function radioButtonList2Click()
{
document.form1.radioButtonList1.SelectedIndex = -1;
}
</script>
<script>
function radioButtonList1Click()
{
document.form1.radioButtonList2.SelectedIndex = -1;
}
</script>
</head>
and
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (radioButtonList1.Attributes["OnSelectedIndexChanged"] == null)
{
radioButtonList1.Attributes.Add("OnSelectedIndexChanged",
"javascript:radioButtonList1Click()");
}
if (radioButtonList2.Attributes["OnSelectedIndexChanged"] == null)
{
radioButtonList2.Attributes.Add("OnSelectedIndexChanged",
"javascript:radioButtonList2Click()");
}
}
}
Thanks a lot
Alex