Andrea Girardi
Andrea Girardi

Reputation: 4437

default value f:textarea

I've a probelm with my JSP. I need to set a default value to a f:textarea field so, for that, on my MVC Controller I extract data from DB and on my JPS I print it:

<textarea id="description" name="description" rows="10" cols="74">
<c:out value="${fn:trim(f_default_text)}" />
</textarea> 

it works fine and my field is filled but, there are some empty char at the beginning of inserted text. I take a look on DB and the value is correct and I tried to print the value on MVC Controller and it's without empty space.

What's happening?

Many thanks guys!
Andrea

Upvotes: 1

Views: 810

Answers (1)

user159088
user159088

Reputation:

I think the <textarea> value is picking up the indentation and line separator between the tags.

Try joining the tags like this (><):

<textarea id="description" name="description" rows="10" cols="74"><c:out
value="${fn:trim(f_default_text)}" /></textarea>

Upvotes: 2

Related Questions