treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Formatting text within text area

  • I'm trying to create a form which has a text area which, when the user copy pastes a resume within the text area, the original formatting is kept intact, when the output is received by the guys handling the admin. Is it possible?

  • what kind of formatting? Do you mean whitespace?

    Whitespace is preserved in form submissions, but it's ignored (not displayed) in HTML. If that's what your problem is, you can either output the submission inside a <pre> element, or convert the whitespace to &nbsp; and/or <br>, as appropriate.

  • This post may be useful for you if you want the user to see the formatting when they paste it in: http://css-tricks.com/forums/discussion/comment/93184#Comment_93184.

  • The

    <

    pre> tag seems to capture the formatting almost accurately. Thanks. I'll have to test the output though(when the admin guys receive the form input). Will post my results asap.

    Thanks.