删除" required"文本出现在textfields下面

时间:2014-05-28 17:03:49

标签: model-view-controller view playframework-2.2

我在playframework中创建了一个表单,但它在我的模型中指定的文本框下面显示了必需的文本。 我的问题是我要删除字段

下面出现的必需的文本

我的代码

@main(title,nav="add") {


<fieldset>
    <legend><h2>Add</h2></legend>



@form(action = routes.ShopController.submit(),'name ->"userForm", 'id -> "shopCreationForm", 'class -> "form-horizontal", 'role->"form", 'onsubmit -> "return validateForm(this);") {

@inputText(userForm("name"), '_label -> "Shop Name*",'class -> "form-control")
@inputText(userForm("addressLine1"), '_label -> "Address Line 1*",'class -> "form-control")
@inputText(userForm("addressLine2"), '_label -> "Address Line 2",'class -> "form-control")
@inputText(userForm("addressLine3"), '_label -> "Address Line 3",'class -> "form-control")
@inputText(userForm("city"), '_label -> "City*",'class -> "form-control")
@inputText(userForm("town"), '_label -> "Town*",'class -> "form-control")
@inputText(userForm("phoneNumber"), '_label -> "Phone*",'class -> "form-control")



    <div>
        <label >Owner Email</label>
        <input type="email" name="owner.email" class="form-control" id="exampleInputEmail1" value="@user" placeholder="@user" readonly>
    </div>

</fieldset>

    <div class="actions">
        <input type="submit" class="btn btn-primary" value="Create">
        <a href="@routes.ApplicationController.index" class="btn">Cancel</a>
    </div>

  }




        }
        }

提前感谢。

1 个答案:

答案 0 :(得分:0)

添加属性'_showConstraints->false

@inputText(userForm("name"), '_label -> "Shop Name*", '_showConstraints->false, 'class -> "form-control")