Reality-Loop

Groovlet quick tip: textarea()

April 13, 2009 | 0 Minute Read
This post was originally posted on my old blog.

Using textarea with Markup Builder in a Groovlet can be tricky.

My initial attempt was:
div()
{
	textarea(name: "content", rows: "3", cols: "60")
}

This however results in invalid html:
<div>
    <textarea name='content' rows='3' cols='60' />
</div>


The correct way is to include an empty string (content of the textarea) in the constructor:
div()
{
	textarea(name: "content", rows: "3", cols: "60", "")
}

Which yields correct html:
<div>
    <textarea name='content' rows='3' cols='60'></textarea>
</div>

I hope this helps, since Groovlet documentation is quite sparse.

http://www.google.com/s2/favicons?domain=twitter.com follow me on twitter, I need some friends :-)