Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms Play 2.2 Scala:简单表单的默认值_Forms_Scala_Playframework_Playframework 2.2 - Fatal编程技术网

Forms Play 2.2 Scala:简单表单的默认值

Forms Play 2.2 Scala:简单表单的默认值,forms,scala,playframework,playframework-2.2,Forms,Scala,Playframework,Playframework 2.2,目前,我有一个简单的表单,form[(String,String,String)] 在我的scala.html文件中: @form(routes.Application.editParticipant(pid)) { @inputText(pForm("email"),'_label -> "Email", '_showConstraints -> false, 'placeholder -> email) @inputText(pForm("passw

目前,我有一个简单的表单,
form[(String,String,String)]

在我的scala.html文件中:

    @form(routes.Application.editParticipant(pid)) {
    @inputText(pForm("email"),'_label -> "Email", '_showConstraints -> false, 'placeholder -> email)
    @inputText(pForm("password"),'_label -> "Password", '_showConstraints -> false, 'placeholder -> password)
    @inputText(pForm("phone"),'_label -> "Phone number", '_showConstraints -> false, 'placeholder -> phone)
    <input type="submit" value="edit">
}
@表单(routes.Application.editParticipant(pid)){
@输入文本(pForm(“电子邮件”),“标签->电子邮件”,“显示约束->假”,“占位符->电子邮件”)
@inputText(pForm(“密码”),“标签->密码”,“显示约束->假”,“占位符->密码”)
@输入文本(pForm(“电话”),“标签->电话号码”,“显示约束->假”,“占位符->电话”)
}

我想表单提交的电子邮件,密码,电话,如果用户不编辑它的当前值。我该怎么做呢?

您可以像这样传递默认值

 @inputText(pForm("email").copy(value=Some("abc@def.com")),'_label -> "Email", '_showConstraints -> false, 'placeholder -> email)

非常感谢。我很感激。