|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I can do this easily in Access, but now I'm working on an ASP.Net project and need some help.
I have a textbox and a listbox on my web page. The listbox is populated from my database table. When the page opens only the textbox is visible. Here is what I am having problems with: When the user begins typing in the textbox, the listbox appears and is filtered by the textbox. I'm been doing some research and it looks like I need to do this with javascript, but I can't figure out how. Any help would be appreciated. |
|
#2
|
||||
|
||||
|
You problem is going to come from the fact that you are trying to filter a server-side control with client-side code...this isn't possible, because in order to filter the database driven listbox, you will need to post the page back to the server.
|
|
#3
|
|||
|
|||
|
What if the datasource for the listbox is an Array, then would it be possible?
|
|
#4
|
||||
|
||||
|
If it was an array passed to the client through javascript, then yes it can be done.
If you are going to do it that way, then look into the OnKeyPress event in javascript. |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > filter listbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|