Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate <input type="search" /> using Play! framework

I'm using the Play Framework. I want to use the HTML5 input type 'search'. So, I want to output:

<input type="search" />

I've tried:

@inputText(field = myForm("myField"), 'type -> "search")

but it still kept the type="input"

like image 717
Kevin Avatar asked Jul 23 '26 16:07

Kevin


1 Answers

the method inputText represents an HTML input text (see the source code here).

You have to define your own template to define the input of type search. Take a look at the Play documentation.

@helper.input(myForm("myField")) { (id, name, value, args) =>
    <input type="search" name="@name" id="@id" @toHtmlArgs(args)>
} 
like image 146
ndeverge Avatar answered Jul 26 '26 11:07

ndeverge