Often you will need to write your own field constructor. Start by writing a template like:
@(elements: helper.FieldElements)
<div class="@if(elements.hasErrors) {error}">
<label for="@elements.id">@elements.label</label>
<div class="input">
@elements.input
<span class="errors">@elements.errors.mkString(", ")</span>
<span class="help">@elements.infos.mkString(", ")</span>
</div>
</div>Note: This is just a sample. You can make it as complicated as you need. You have also access to the original field using
@elements.field.
Now create a FieldConstructor somewhere, using:
@implicitField = @{ FieldConstructor(myFieldConstructorTemplate.f) }
@inputText(myForm("username"))I tried options 3 and 4 above. Off-course, FieldConstructor is unresolved. So what do I need to import to resolve that and am I even moving in the right direction?
quantity and quality of node.js standards.