ASP.NET Listbox and javascript?

Results 1 to 2 of 2

Thread: ASP.NET Listbox and javascript?

  1. #1
    Join Date
    Dec 1969

    Default ASP.NET Listbox and javascript?

    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&#039;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.. <BR>to test this i made the below code to see how to integrate javascript in asp.NET <BR><BR>i made a list box and added a javascript function to it <BR>i made the listbox <BR>&#060;asp:listbox id="lstFilter" Runat="server"&#062;&#060;/asp:listbox&#062; <BR>i added a javascript event to it on PageLoad <BR>lstFilter.Attributes.Add("onchange", "SelectPair(window.document.form1.lstFilter.option s[selectedIndex].text);") <BR>then i wrote the javascript function : <BR>&#060;script language="javascript"&#062; <BR>function SelectPair(window.document.form1.lstFilter.options[selectedIndex].text) <BR>{ <BR>// <BR>window.document.Form1.lstFilter.options[selectedIndex].text = "hahahah" <BR>} <BR>&#060;/script&#062; <BR>but nothing is working....can u pls help.... <BR>tks a lot...<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: ASP.NET Listbox and javascript?

    i&#039;ve fought and fought with this exact situation with &#060;asp:listbox&#062; and javascript.. i finally scrapped a days of work and just used it all on the server side on Post-back events..... much much much easier

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts