0

In my web-application I have a the following requirement.

I need to have a dropdown for country.
Based on the country selected I need to display the corresponding states.
I need to fetch both the country and state from database.

I cant use javascript since in production(live), javascript will be disabled.

I guess I have to use ajax to implement this?

Can anyone please tell if there is any better way to implement the above requirement?

I have seen the following link.
Populating cascading dropdown lists in JSP/Servlet

But I dont like to use javascript (since my client will disable javascript in Production environment)

Community
  • 1
  • 1
user1514499
  • 762
  • 7
  • 26
  • 63
  • If you want to generate states for the associated COUNTRY, when you select country a javascript event must be raised and you can call server component using AJAX.. When no javascript how can you send request first? – Mr.Chowdary Jul 25 '12 at 04:56

1 Answers1

2

I cant use javascript since in production(live), javascript will be disabled.

Can't use javascript than you would have to refresh the page i.e.:

  1. Select Country from drop-down
  2. Provide a link or button to submit this value (click on this)
  3. Server call, which will retrieve the Country values and also the State values for the country selected
  4. display the JSP with the values retrieved and make the Country which was submitted pre-selected in the drop-down.

I guess I have to use ajax to implement this?

Now my friend you are contradicting your own self, because ajax (I am sorry to say this) is nothing but javascript, it is not some different language than javascript.

Prakash K
  • 11,669
  • 6
  • 51
  • 109