Play Framework forms: specifying @textarea rows and columns

To specify the rows and columns in a Play Framework 2.1.x form field, use a syntax like this:

    '_label -> "Notes",
    'placeholder -> "Any notes you want to add",
    'rows -> 5,
    'cols -> 60

The textarea documentation shows that you can also specify the textarea size like this:

@textarea(field = myForm("address"), args = 'rows -> 3, 'cols -> 50)

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.