Q:

play framework bind form field to checkbox

How can I bind a field in myForm called "isMarried" to the checkbox control in view? I want this binding bi-directional. I am using bootstrap switch from https://github.com/nostalgiaz/bootstrap-switch
@(myForm: Form[_])
@helper.form(action = controllers.index.submit, 'id -> "myForm") {

<fieldset>
<legend>General information</legend>
<div class="twipsies well">
   <div class="control-group">
        <label class="control-label" for="isMarried">Married</label>
        <div class="controls">
            <div class="switch switch-small" tabindex="0" data-on-label="Yes" data-off-label="No" data-off="warning">
                <input id="isMarried" name="isMarried" type="checkbox"/>
            </div>
        </div>
    </div>

</div>

</fieldset>
}

A:

I dit not worked with checkboxes (in Pay) but I would use the checkbox helpers: 
Example:
@checkbox(field = myForm("done"))

See source: https://github.com/playframework/Play20/blob/master/framework/src/play/src/main/scala/views/helper/checkbox.scala.html
If you nee to customize the HTML out to fit your needs, write your own helper / tag:

http://www.playframework.com/documentation/2.0.2/JavaFormHelpers
Is it possible to override form helpers?
Creating a custom field constructor in Play 2 (scala)

Good luck!

