I am new to play framework so please bear with me. Can some one explain to me how to access an item selected in a play 2 framework drop down list, using a jQuery function?
For example:
<select class = "selectone">
@for(gesture <- gesturesList){
<div class = "gesture" > <option value = @gesture.id>
@gesture.getName()
</option>
</div>}
</select>
The above drop down list is populated by the following function:
public static Result gesture()
{
List <Gesture> gcet = Gesture.find.orderBy("name asc").findList();
return ok(views.html.train.render(gcet));
}
I want to access the selected item using jQuery or maybe JavaScript. Any suggestion.
Unless I misunderstood, that’s nothing to do with Play, it’s pure Jquery:
That said, you are adding a
divin your select, it shouldn’t be like that. Your code should be: