actually what i want to do is that i have two list boxes. when i click any one one a particular item, the other listbox's same idex item should get highlighted too.. producing a list of listview effect ie. whenever an item is clicked on either of the listboxes, the sames index item on the other listbox will get highlighted too..
to test this i made the below code to see how to integrate javascript in asp.NET
i made a list box and added a javascript function to it
i made the listbox
<asp:listbox id="lstFilter" Runat="server"></asp:listbox>
i added a javascript event to it on PageLoad
lstFilter.Attributes.Add("onchange", "SelectPair(window.document.form1.lstFilter.options[selectedIndex].text);")
then i wrote the javascript function :
<script language="javascript">
function SelectPair(window.document.form1.lstFilter.options[selectedIndex].text)
{
//lstvalue.select(
window.document.Form1.lstFilter.options[selectedIndex].text = "hahahah"
}
</script>
but nothing is working....can u pls help....
tks a lot...
to test this i made the below code to see how to integrate javascript in asp.NET
i made a list box and added a javascript function to it
i made the listbox
<asp:listbox id="lstFilter" Runat="server"></asp:listbox>
i added a javascript event to it on PageLoad
lstFilter.Attributes.Add("onchange", "SelectPair(window.document.form1.lstFilter.options[selectedIndex].text);")
then i wrote the javascript function :
<script language="javascript">
function SelectPair(window.document.form1.lstFilter.options[selectedIndex].text)
{
//lstvalue.select(
window.document.Form1.lstFilter.options[selectedIndex].text = "hahahah"
}
</script>
but nothing is working....can u pls help....
tks a lot...
Comment