+ Start a Discussion
vepakvepak 

handling apex:inputTextarea value in apex class

I developed a visualforce page which has Text area field. When I tried to pass the value to string variable in a class it is not handling newline character.

 

for example: if I enter a text below in the visualforce page text aera field

 

"Hello sir,

 

how are you

 

Thanks"

 

 

if I try to print it in a class it prints as  "Hello sir,how are you Thanks" 

 

Can anyone help me in this.

 

Thanks,

 

Vamsi.

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Try applying "<br/>" or "\n" in the text of textarea.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

Try applying "<br/>" or "\n" in the text of textarea.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
vepakvepak

Thanks Ankith,

 

it worked.

Kris2012Kris2012

Hi I want the Firstname to be appera on the texbox who ever logins and i am ok with {!$User.FirstName} this code but i want it to be printed in the text box.