How to populate dropdown list with database using ajax in jsp

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

The best video i found for dependent drop down list using JSP is this. update the content of your github repository because the cities table creation is not there.

Thanks for your code

nashwanth
Автор

Hi. It’s very informative. I have a usecase that is required to make an Ajax call to the city-list api once user enter postal code, then we need to auto populate city and the country on the registration page dropdown fields, then state should be auto populate once user choose the city. If there are multiple cities and the countries for the same zip code, then populate list of cities in the dropdown and country dropdown, but for the country dropdown field must be append with “not found or other” option during multiple countries in the backend api response. Any helpful references or thoughts on this usecase ?

DG-cdjb
Автор

For those who want in Eclipse follow these steps:-
1) Open eclipse and create a new Maven project.
2) Now add Mysql connector dependency in pom.xml from the Maven repository.
3) If you are still getting some error. It's because you have not attached the Tomcat server. For that, right-click on your project name, go to properties, click on 'Targeted Runtimes' and check the checkbox for 'apache tomcat server'. Apply and close.
4) Now right click on your project name and create three new JSP files named index, state, and city.
5) Do not create JSP files in WEB-INF.
6) Type the code exactly as shown. Make sure you change the database name. and username and password.
7) Now to run the code, right-click on the index.jsp file and click run on the server, DO NOT right-click on your project name and run. It will only run by right-clicking on the index.jsp page.

sanketsaitawdekar
Автор

how to populate state on same page and data should be available in country dropdown.

ishtiaq
Автор

2nd dropdown states field is not showing anything on click

shiva-tuqs
Автор

this is nice video... please can you send me the code

ganeshpadala