Re: Why does this code NOT execute ?



On Jan 29, 11:20 pm, Alex <cuca_macaii2...@xxxxxxxxx> wrote:
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

What language is that? It is not Javascript for sure. Looks a bit like
Microsoft JScript 7.0/8.0 with non-existing DOM methods. If it's one
of Microsoft ASP jargons, you may ask at
microsoft.public.scripting.jscript
If it is intended to be an universal Javascript code then please
explain the intended behavior and let's start to clean up.
.


Quantcast