Advertisement
Guest User

multiDataField.scala.html

a guest
Feb 16th, 2015
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.42 KB | None | 0 0
  1. @(field: Field, label: String = "CHANGEME", optionMap: List[String], help: String = "")
  2.  
  3. <div class="form-group @if(field.hasErrors) {has-error}">
  4.     <label class="col-sm-2 control-label" for="@field.id">@label</label>
  5.     <div class="col-sm-10 multi-field-wrapper">
  6.         <div class="multi-fields">
  7.             <div class="multi-field">
  8.                 <div class="col-sm-5 gsn-data-input">
  9.                     <input type="text"
  10.                    class="form-control"
  11.                    name="@field.name"
  12.                    value="@field.value.getOrElse("")"/>
  13.                 </div>
  14.                 <div class="col-sm-5">
  15.                     <select
  16.                    class="form-control"
  17.                    name="@field.name-type">
  18.                     <option class="blank" value="">Please select a value</option>
  19.                     @for((optionName) <- optionMap) {
  20.                        <option id="@optionName" value="@optionName">@optionName</option>
  21.                     }
  22.                     </select>
  23.                 </div>
  24.                 <button type="button" class="btn btn-default remove-field col-sm-push-10">Delete</button>
  25.             </div>
  26.         </div>
  27.         <span class="help-block">@help</span>
  28.         <span class="help-block">@{field.error.map { error => error.message }}</span>
  29.         <button type="button" class="btn btn-default add-field">Add field</button>
  30.     </div>
  31. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement