Thanks for the reply. But this does not resolved my issue. I think client side code is always faster than server side code. Also I do not want to do a post back. I have also tried it with server side code but its even slower than the above code. Any other code would be appreciated.
On Nov 7, 5:28 pm, Liam Potter <[EMAIL PROTECTED]> wrote: > why not have an "all" option in your select box and do the rest server side? > > JQueryProgrammer wrote: > > Hi All, > > > I am trying to write a JQuery function which would select all my > > options in the select control with the click of a button. I am able to > > do it with the following function: > > > $("#btnAll").click(function() { > > $("#myselect *").attr("selected","selected"); > > }); > > > But the problem is my select list box has more than 5000 values and > > selecting each option with this method takes much time and scrolls the > > whole select box. > > > Can anyone please help me in optimizing this function so that I can > > instantly select without the user getting displayed about the > > scrolling.