function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Natraj Subramani 15Natraj Subramani 15 

HTML Tag Textarea not displayed in Visualforce page

Hi Team,

I need a textarea box displayed in my visualforce page (which is rendered as PDF). I used the below code, for some reasons I dont see the box at all. Am I misisng something ?

<apex:page rendered="true" renderAs="pdf" sidebar="false" lightningStylesheets="true" applyHtmlTag="true" doctype="html-5.0">
<html>
 <textarea richtext="true" cols="50" rows="5" required="true"></textarea>
</html>
</apex:page>

Also please confirm how we can have borders around fields.  I basically need to have borders for my section of fields.

Thanks
Natraj
Best Answer chosen by Natraj Subramani 15
Raj VakatiRaj Vakati
HTML tags are not going to render direcly in PDF .. YOU NEED TO SET THE CSS 

TRY like below
 
<apex:page rendered="true" renderAs="pdf" sidebar="false" lightningStylesheets="true" applyHtmlTag="true" doctype="html-5.0">
    <style>
        
    </style>
    <html>
         
        <textarea richtext="true" cols="50" rows="5" required="true" style="border:1px solid #007ACC;width:213px;height:215px;"> THIS IS DMEO </textarea>
    </html>
</apex:page>

 

All Answers

Raj VakatiRaj Vakati
HTML tags are not going to render direcly in PDF .. YOU NEED TO SET THE CSS 

TRY like below
 
<apex:page rendered="true" renderAs="pdf" sidebar="false" lightningStylesheets="true" applyHtmlTag="true" doctype="html-5.0">
    <style>
        
    </style>
    <html>
         
        <textarea richtext="true" cols="50" rows="5" required="true" style="border:1px solid #007ACC;width:213px;height:215px;"> THIS IS DMEO </textarea>
    </html>
</apex:page>

 
This was selected as the best answer
Natraj Subramani 15Natraj Subramani 15
Hi Raj,

You are right, when I remove render as pdf from apex page tag, the textarea comes correctly. Adding styles worked perfectly fine. Thank you so much for the prompt answer

Regards
Natraj