Unable to get property 'options' of undefined or null reference RSS

ryoka012

Active member
Joined
Oct 13, 2011
Messages
32
Programming Experience
Beginner
[FONT=&quot]Hi experts,[/FONT]
[FONT=&quot]I am new on using the Javascript in asp.net and i have a problem on this code.[/FONT]

Code:
[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=&quot]Can anyone help me please.[/FONT]
[FONT=&quot]thanks.[/FONT]
 
Top Bottom