Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play framework input without label

I've just started with Play Framework and I'm looking to create input field in scala template but without label and for some reason I'm unable to get rid of the generated label element. Here is how my code looks like :

@helper.inputText(form("name"), 'id -> "name", 'class -> "ui-state-default", 'autocomplete -> "off", 'placeholder -> "Please write name ...")

So I end up with this element along with my input (looking at browser source code) :

<dt><label for="s2id_autogen2">name</label></dt>

Is there any way of removing it?

like image 734
Gandalf StormCrow Avatar asked Aug 26 '13 12:08

Gandalf StormCrow


People also ask

Is Play framework still used?

Play is rock-solid and used by hundreds of thousands of Java and Scala developers every month. Play is still extremely relevant to today's application and web development and has a passionate and very capable community around it ensuring that it has many good years left.

What is activator in play framework?

The activator command can be used to create a new Play application. Activator allows you to select a template that your new application should be based off. For vanilla Play projects, the names of these templates are play-scala for Scala based Play applications, and play-java for Java based Play applications.

Is Play framework backend?

Play comes with two configurable server backends, which handle the low level work of processing HTTP requests and responses to and from TCP/IP packets. Starting in 2.6. x, the default server backend is the Akka HTTP server backend, based on the Akka-HTTP server.

What is form in play framework?

Play's form handling approach is based around the concept of binding data. When data comes in from a POST request, Play will look for formatted values and bind them to a Form object. From there, Play can use the bound form to value a case class with data, call custom validations, and so on.


1 Answers

My solution was :

@helper.inputText(form("name"), 
    'id -> "name",
    'class -> "ui-state-default",
    'autocomplete -> "off",
    'placeholder -> "Please write name ...",
    '_label -> null
)
like image 199
Gandalf StormCrow Avatar answered Oct 12 '22 09:10

Gandalf StormCrow