2

My form doesn't seem to work when I add attributes to my form, this is how the form looks like right now(this code doesn't work):

advPlaatsen.scala.html

@import helper._
@implicitField = @{ FieldConstructor(myPlainFieldConstructor.f) }
@form(routes.Application.newAdv, 'enctype -> "multipart/form-data") {
<div class="row collapse">
    <div class="small-2 columns">
            <span class="prefix">Jaar</span>
    </div>
    <div class="small-4 left columns">
            @inputText(advForm("Jaar"),
            'id -> "right-label",
            'placeholder -> "Jaar",
            'name ->"jaar")
    </div>
    </div>
<input type="submit" value="Create">
}

myPlainFieldConstructor.html.scala:

@(elements: helper.FieldElements)
@elements.input

I'm using a total of 6 input types, five of them are text and one is a file input, they seem to be working perfectly when it the default helper:

@inputText(advForm("Jaar"))

If you need any more of my code please let me know,

I used this answer on Stackoverflow.

dds
  • 2,335
  • 1
  • 31
  • 45
creativename
  • 304
  • 2
  • 16

1 Answers1

0

Your custom FieldConstructor is a scala file, not a scala template.

Change

myPlainFieldConstructor.html.scala

To

myPlainFieldConstructor.scala.html
David Gordon
  • 287
  • 4
  • 17