View Full Version : Filter dyanmic table content based on the characters typed in the textbox

05-14-2008, 03:53 PM
i have a jsp page where on click on a button a new window gets opened up which contains data retieved from the database. also there is a text box on top with label where if user enters any character then corresponding to that character the data should get filtered in that table.
there is a button on index.jsp. click on this button results in the pop up of the child window where a table gets created containing the data retrieved from the database. also there is a text box on top where now if user enters any character data in the table gets filtered corresponding to that character(s)

<input type="text" name="text">(text box on the child window)
S.No. CityName
1 Delhi
2. Mumbai
3. Jaipur
5. Jodhpur
6. kolkata
(all these values are stored in the database and retrieved in a query) now my requirement is that if user enters J then all the cities starting with J should get displayed on the same page. I am using ajax for this but i need a javascript solution for doing this.

output should be:
S.No. CityName
3. Jaipur
4. Jodhpur

i am using ajax and struts. please help me solve this problem.thanks in advance