• Post Reply Bookmark Topic Watch Topic
  • New Topic

Chained Select Drop Down box

 
Luke Zechariah
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am new to groovy/grails

I am trying to develop a code in gsp for chained select drop down. There are two drop downs. One for state and another for county.

That is if I select a state, it should show the corresponding counties. If I select Iowa, the counties drop down shoul display Fremont, Harrison, Mills.

I have an enum with counties for each state. Please help me develop a gsp select with javascript or Jquery or ajax. Here is the code below

Here is the code snippet.



HTML Code


 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36027
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luke,
There's a jQuery plugin that does chained selects. I recommend you use that rather than trying to write from scratch.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!