formatting part of a text field

Posted on 2009-02-11
Last Modified: 2013-11-19
i have the code below that basically is a reply to a message that when the user submits it puts the original message underneath whatever they type in, what i need is to format <%=reformat(rsMsg.Fields.Item("Body").Value)%> as a smaller font.  i tried using css but that will only format the whole textarea, any ideas just to format that one part?
<textarea name="body" cols="50" rows="10" wrap="VIRTUAL" onChange="getTheText(this)" onClick="getTheText(this)">                                                                                                         ------------------------------             <%=reformat(rsMsg.Fields.Item("Body").Value)%></textarea>

Open in new window

Question by:ckawebcreation
    LVL 5

    Accepted Solution


    CSS will only apply to the whole textarea, on it's own there is no way to format individual lines in the way you require.  Your options are to use a div in place of the textarea, which will allow you to format the text, use contenteditable on an iframe, to enable you to write rich text to it or use an off the shelf richtext editor from yahoo's yui project, or similar.

    The chosen route really depends on whether or not you want the user to be able to edit the outputted text, or just read and/or selected it for copy/paste.


    Author Comment

    cheers, i didn't think so.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
    Read about why website design really matters in today's demanding market.
    The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Click on Too…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now