I have a program where I'm displaying a set of names in the form of a drop-down list using HTML on the browser. At present there are few names, but in future will add more to database. Now, my problem is, even the new names should get added to the drop down list automatically, without updating the HTML. How can I do this? How can the data be fetched directly from the database and at the same time be displayed in the drop down list?
Am using JSPs and servlets as back-end to update the database and display. Is there any way out for this or should one hard code to get the data displayed on the drop-down list?
Thanks & Regards
I "try", I "catch" and "finally" WIN !!!
Swapna Gouri Kalanidhi wrote:Hi All
At present there are few names, but in future will add more to database. Now, my problem is, even the new names should get added to the drop down list automatically, without updating the HTML.
AJAX, Have you used it ? If not, AJAX will solve problem, without hard coding any database values in HTML !!
Just on onLoad () function of HTML page, call AJAX and it will populate the drop-down list.
Thanks for the quick reply ! I haven't used Ajax till date and have no idea about Ajax. I'm a newbie to Java technologies. Instead of Ajax, is there any other way I can populate the data? I mean, is it not possible using JSPs or servlets or JSTL or such technologies? Because my entire project is on MVC architecture. And am almost reaching the deadline, so I cannot afford to learn a new technology at this point of time and apply.
Any suggestions would be much appreciated. Thanks again for your quick response !