I am using Play 2.1 I made a select drop down box using the helper field constructor. The drop down box have 3 fields, default:"choose a gender", Male, and Female. How do I ensure that the user choose one of male or female, and not the default value? (A required drop down field)
相关问题
- PlayFramework: how to transform each element of a
- Jasper: error opening input stream from url
- is it normal for image inputs to be omitted from t
- How do I discard user input delivered during sleep
- How to make CSS input range thumb not appear at fi
相关文章
- 放在input的text下文本一直出现一个/(即使还没输入任何值)是什么情况
- Show a different value from an input that what wil
- Is there a way to hide the new HTML5 spinbox contr
- Testing request with CSRF Token in Play framework
- Programmatically interrupting raw_input
- Bootstrap input field inside tooltip popover remov
- How to map an abstract collection with jpa?
- ValueError: too many values to unpack (expected 2)
I am using Play!Framework 2.1.0, below is a simple solution for your problem:
The model should be like this: (Below is simple model for your problem)
The controller should be like this:
The template/view should be like this:
See also this post as reference : Use of option helper in Play Framework 2.0 templates