Hi all,
I’m training in Servlets, JSP and JavaScript,.
Here is a snapshot of a portion of my web page, there’s a “StudentName” textbox and below it is a “Names” Dropdown list.
The requirement is that as soon as one goes on typing the letters in the StudentName-textbox the corresponding matching names have to appear in the DD located below.
Like say if I just key in “J” then all the student-names from the “Names – table(backend-MySql)” starting with J have to appear in the DD, say if I’m typing in “Jo” then just names such as “John”,” Joanna” etc need appear ..
What I had in mind is that maybe through JSP I could on page load itself collect all the Names from the Names-table and maybe store them in a hidden field on my page itself and then on the onFocus() event of the textbox I could retrieve the text keyed into the textbox into some variable and compare the first letter of that text with the first letter of all the names present in my hidden field one by one and then whatever names match I just populate them into the DD ..but this achieves only half the purpose …
Can anyone help me with suggestions regarding this…
P.S:- Is it also possible through Java/JavaScript to link a particular control directly to some database table?
For e.g. can I directly link a DD to some table and have just the dropdown refreshed every time there was an addition/deletion to the table and not the whole page..
Thanks,