wood burning stoves 2.0*
The moose likes JSP and the fly likes How to code the Country and State Drop down buttons in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to code the Country and State Drop down buttons in jsp" Watch "How to code the Country and State Drop down buttons in jsp" New topic
Author

How to code the Country and State Drop down buttons in jsp

nalamati satyanarayana
Ranch Hand

Joined: Dec 16, 2005
Posts: 36
Hi All,
Please help how to code the country and state drop down buttons in jsp
I am getting data from the database First i have to show all country list after According to the user selection i need to display the states in country.
Here i am using servlet class to connect the database for front end i am using jsp.


Satya
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
It is very easy

You can do it 2 ways.

1.On Server side
- Submit the country code to your jsp
- Use the country code get the list of states from the database
- Build the html pull down (<select></select>) in your jsp
2.On the client side
- When the user changes a country
- Make a remote scripting operation using AJAX (http://www.w3schools.com/ajax/default.asp). It is nothing but making a hidden http request to a jsp or servlet which should return the list of states for a given country
- Use the list and build the pull down using javascript (http://www.javascriptkit.com/javatutors/selectcontent.shtml)


I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to code the Country and State Drop down buttons in jsp
 
Similar Threads
Auto generate drop down list
Calling javascript country-state value in servlet through JSP form
select values for second drop down
JavaScript Validation in Struts for Drop Down List
How to retrieve data from database when ever select in drop down list?