Formatting parragraphs in text_are

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alanwallace
    New Member
    • Mar 2007
    • 2

    #1

    Formatting parragraphs in text_are

    Hi All,

    I am a newby and a silver surfer and wander if anyone can give ma a hand.
    I am installing a double drop box on a friens website and have hit a problem. I can not find a way to format parragraphs in the text box. This is one of the Text_area that I need to alter.

    "
    text_array[1] = new Array("DIAMOND SBS / TD UNDERLAY / INSULATION, 15 Year Guarantee - System-11, 20 Year Guarantee - System-2",
    "
    You can see the drop box at http://www.europolymers-gb.com/eb-we...of-design.html.
    I would like the display to look like this:

    DIAMOND SBS / TD UNDERLAY / INSULATION
    15 Year Guarantee - System-1
    20 Year Guarantee - System-2.
    instead of like this:

    DIAMOND SBS / TD UNDERLAY / INSULATION 15 Year Guarantee - System-1 20 Year Guarantee - System-2.

    Can you Help
    Silver Surfer
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    return the array as a string of text joined by newlines, and set your textarea style to preserve the whitespaces

    in your stylesheet:
    #textareaname{w hite-space:pre}

    writing to the textarea:
    textareaname.va lue= text_array[1].join('\n')

    Comment

    • alanwallace
      New Member
      • Mar 2007
      • 2

      #3
      Sorry for my ignorance but I didn't understand a word of that. The script did not come with a stylesheet. Is there a tutorial on this anywhere?
      Silver Surfer

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Are you not using stylesheets on the page? (The page link that you gave doesn't exist).

        You can set the style using javascript:
        Code:
        textareaObj.style.whiteSpace='pre';
        where textareaObj is the ID to your textarea.

        Comment

        Working...