Using function on click event
-
I have a bound listbox to a sql datasource, the problem I have been having is that when I use the multiple select property I need to perform another procedure to find the highest factor of the selected items and return this to part of the form. I have looked at using javascript but i'm not the best at it so if anyone can think of another way could you let me know.
-
I have a bound listbox to a sql datasource, the problem I have been having is that when I use the multiple select property I need to perform another procedure to find the highest factor of the selected items and return this to part of the form. I have looked at using javascript but i'm not the best at it so if anyone can think of another way could you let me know.
Here are the steps that you may do: + Create the handler for the client side events of the listbox control like onclick, onchange, see select element[^]. You can register the handler in the control declaration or in code with the
Attributes
collection of the control. + Use javascript to walk through the item collection using the the options[^] property to collect the selected items and determine the highest one. You can also easily find lots of sample scripts out there to access the contests of the select element. Just out of curiousity why you don't just do that at the server side as it seems much easier.