Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Chained Select Drop Down box  RSS feed

 
Ranch Hand
Posts: 144
  • 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


 
author & internet detective
Marshal
Posts: 37896
594
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.
 
Danger, 10,000 volts, very electic .... tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!