我正在使用 Play 框架。我想使用 HTML5 input type 'search' .所以,我想输出:
<input type="search" />
我试过:
@inputText(field = myForm("myField"), 'type -> "search")
但它仍然保留了 type="input"
最佳答案
inputText
方法表示 HTML 输入文本(参见源代码 here)。
您必须定义自己的模板来定义search
类型的输入。看看 Play documentation .
@helper.input(myForm("myField")) { (id, name, value, args) =>
<input type="search" name="@name" id="@id" @toHtmlArgs(args)>
}
关于scala - 使用 Play 生成 <input type ="search"/>!框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11952146/