+ Reply to Thread
Results 1 to 5 of 5

Thread: Formatting text

  1. #1
    Barn Regular developer10 is an unknown quantity at this point developer10's Avatar
    Join Date
    Apr 2010
    Posts
    52
    Rep Power
    2

    Formatting text

    I have a content management system where the user has to put in match reports for a sport. I am using a text area to do this, then calling this text area via a form and placing it into my Access database.

    The question is :

    Is there a way to format the text when the user is putting it into the database so that they can use new paragraphs?

    At the minute the report all comes out as one big piece of text in only one paragraph, however i would like it so the user can break up their report into different paragraphs

  2. #2
    Super Sarcasm Mistress mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere's Avatar
    Join Date
    Mar 2008
    Location
    Wide Awake In Dreamland
    Posts
    830
    Rep Power
    8

    they should be able to use line breaks and what not in the textarea. how are you inserting into the database ... and how are you displaying it?
    Quote of the Month:
    INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.

    Questions to Ponder:
    Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?

    iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
    copyright © 2008 sbenj69

    Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.

  3. #3
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    A text area uses a vb carriage return to create a new line, vbcrlf. HTML uses <br> to create a new line. So, you have to replace one for the other when inserting into the database.

    I'd suggest looking into rich text editors which allow the user to format HTML in a WYSIWYG style and then you can insert the full HTML into the database.

    Hope that helps.

  4. #4
    Barn Regular developer10 is an unknown quantity at this point developer10's Avatar
    Join Date
    Apr 2010
    Posts
    52
    Rep Power
    2

    Quote Originally Posted by mehere View Post
    they should be able to use line breaks and what not in the textarea. how are you inserting into the database ... and how are you displaying it?

    Inserting the stuff through an sql string. Diplaying it as it was put into the textarea, altho when I use a new line in the textarea this is not displayed in HTML....think the reply below might be the solution to that problem. Thanks

    Quote Originally Posted by richyrich View Post
    A text area uses a vb carriage return to create a new line, vbcrlf. HTML uses <br> to create a new line. So, you have to replace one for the other when inserting into the database.

    I'd suggest looking into rich text editors which allow the user to format HTML in a WYSIWYG style and then you can insert the full HTML into the database.

    Hope that helps.
    Is this what you are talking about?

    Through The Web Rich Text (WYSIWYG) Editor

    This is for php, although im using ASP. Would it be hard to change the code to ASP?

  5. #5
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    Take a look here: Property Viewer for a whole bunch of editors. I've played with TinyMCE a bit and FCK -- both seem to do the job.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

+ Reply to Thread

Similar Threads

  1. Formatting to ShortDate when Binding data
    By richyrich in forum .NET Development
    Replies: 15
    Last Post: April 22nd, 2010, 08:11 AM
  2. Formatting Issue please assist
    By CCCSteve in forum SQL Server Reporting Services Help
    Replies: 2
    Last Post: February 19th, 2010, 05:17 PM
  3. Replies: 5
    Last Post: November 23rd, 2009, 08:24 AM
  4. Handling SubTotal Formatting in Matrix
    By harish in forum SQL Server Reporting Services Help
    Replies: 9
    Last Post: June 11th, 2009, 03:32 PM
  5. Error formatting dates
    By richyrich in forum .NET Development
    Replies: 10
    Last Post: July 28th, 2008, 02:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO