I have a model that contains a String and a list:
public String title;
public List<String> topics;
In index.scala.html I use a form to add new items:
@form(routes.Application.newPaper()) {
@inputText(paperForm("title"))
<input type="submit" value="Create">
}
with a simple String, this works nicely. But I would like to show checkboxes
@for(t <- topics) {
<input type='checkbox' name='topic' value=@t>@t <br>
}
and subsequently add all checked 'topics' to the List<String> topics; of my new item. How can I process the checkboxes within @form{ ... }?