lundi 6 avril 2015

How to pre-select radiobutton- / checkbox-group in the playframework?

I am trying to construct a simple form with the Play!Framework 2.3.8. Therefore I have created a radiobutton group, which works fine, but how do you pre-select a certain radiobutton?


I did not find anything for this in the documentation:


Documentation radiobuttons


The same problem exists for checkboxes:


Documentation checkboxes



@helper.form(action = routes.Application.submit(), 'id -> "userForm"){
<fieldset>
@helper.inputRadioGroup(
userForm("Geschlecht"),
options = options("Mann"->"Mann","Frau"->"Frau"),
'_label -> "Gender",
'_error -> userForm("Geschlecht").error.map(_.withMessage("select gender"))
)
</fieldset>


Any ideas?





Aucun commentaire:

Enregistrer un commentaire