[FONT="]Hi experts,[/FONT]
[FONT="]I am new on using the Javascript in asp.net and i have a problem on this code.[/FONT]
[FONT="]Can anyone help me please.[/FONT]
[FONT="]thanks.[/FONT]
[FONT="]I am new on using the Javascript in asp.net and i have a problem on this code.[/FONT]
VB.NET:
[COLOR=#A31515]<asp:DropDownList[/COLOR][COLOR=#000000] [/COLOR][COLOR=red]ID[/COLOR][COLOR=#000000]=[/COLOR][COLOR=#0000FF]"DropDownList1"[/COLOR][COLOR=#000000] [/COLOR][COLOR=red]runat[/COLOR][COLOR=#000000]=[/COLOR][COLOR=#0000FF]"server"[/COLOR][COLOR=#A31515]>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<asp:ListItem>[/COLOR][COLOR=#000000]item 1[/COLOR][COLOR=#A31515]</asp:ListItem>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<asp:ListItem>[/COLOR][COLOR=#000000]item 2[/COLOR][COLOR=#A31515]</asp:ListItem>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<asp:ListItem>[/COLOR][COLOR=#000000]item 3[/COLOR][COLOR=#A31515]</asp:ListItem>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<asp:ListItem>[/COLOR][COLOR=#000000]item 4[/COLOR][COLOR=#A31515]</asp:ListItem>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<asp:ListItem>[/COLOR][COLOR=#000000]item 5[/COLOR][COLOR=#A31515]</asp:ListItem>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<asp:ListItem></asp:ListItem>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]</asp:DropDownList>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]<script[/COLOR][COLOR=#000000] [/COLOR][COLOR=red]type[/COLOR][COLOR=#000000]=[/COLOR][COLOR=#0000FF]"text/javascript"[/COLOR][COLOR=#A31515]>[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#0000FF]function[/COLOR][COLOR=#000000] setSelectedIndex[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]s[/COLOR][COLOR=#000000],[/COLOR][COLOR=#000000] i[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000] [/COLOR][COLOR=#000000]{[/COLOR][COLOR=#000000]
s[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]value[/COLOR][COLOR=#000000][[/COLOR][COLOR=#000000]i [/COLOR][COLOR=#000000]-[/COLOR][COLOR=#000000] [/COLOR][COLOR=red]1[/COLOR][COLOR=#000000]].[/COLOR][COLOR=#000000]selected [/COLOR][COLOR=#000000]=[/COLOR][COLOR=#000000] [/COLOR][COLOR=#0000FF]true[/COLOR][COLOR=#000000];[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#0000FF]return[/COLOR][COLOR=#000000];[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000]
setSelectedIndex[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]document[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]getElementById[/COLOR][COLOR=#000000]([/COLOR][COLOR=#A31515]"DropDownList1"[/COLOR][COLOR=#000000]),[/COLOR][COLOR=#000000] [/COLOR][COLOR=red]5[/COLOR][COLOR=#000000]);[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#A31515]</script>[/COLOR]
[FONT="]thanks.[/FONT]