SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Montgomery, TX
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Inserting <p> tags in form field text.

    I've got a form where a user can enter a baseball game summary article. I have a text field for the title and text field for the body. I want to be able to add <p>/</p> tags around the paragraphs in the body, before saving it to the database. Is there a way to scan the text and look for the carriage return/line break and do this?

    Thanks,

    David

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would most likely be better off using Javascript for this - the only way to go since it's the client side the user is entering something into a FORM.

    You could do it server side but I don't really see the point of this.

    Do a general search for the DOM and dHTML and Javascript on google for example and see what that throws back.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Montgomery, TX
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    You would most likely be better off using Javascript for this - the only way to go since it's the client side the user is entering something into a FORM.

    You could do it server side but I don't really see the point of this.

    Do a general search for the DOM and dHTML and Javascript on google for example and see what that throws back.

    Thanks Doc, I'll give that a try.


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
  •