Skip to content

Commit

Permalink
Added hidden scala form (For inclass WOD)
Browse files Browse the repository at this point in the history
  • Loading branch information
aghalarp committed Oct 23, 2013
1 parent 288cfbf commit 0b89b75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/views/NewContact.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
@Main("NewContact") {
<div class="container">
@form(routes.Application.postContact(), 'class -> "form-horizontal") {
<input type="hidden"
name="@contactForm("id").name"
id="@contactForm("id").id"
value="@contactForm("id").value">


@hidden(contactForm("id"))

@text(contactForm("firstName"),
label = "First",
Expand Down
12 changes: 12 additions & 0 deletions app/views/bootstrap3/hidden.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@(field: Field)

<div class="form-group @if(field.hasErrors) {has-error}">

<input type="hidden"
class="form-control"
id="@field.id"
name="@field.name"
value="@field.value.getOrElse("")" />


</div>

0 comments on commit 0b89b75

Please sign in to comment.