Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    Everthorpe, nr Hull, UK
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Find and replace code using javascript

    Hi there

    Does any one know how set a javascript up to find and replace code in a text area.

    I have form that summits content into my database and if you copy and paste strait from a word doc it submits all the word formatting into the database and then ignores the style applied to the text on the page that pulls it from the database.

    I want to the script to check the content and replace any <p> tags that have word formatting code for html code. so that the text doesn't change in appearance.

    so the word li tags are replaced, if i have to put exactly what it should find and replace it with then even better as i can replace font tags from word for the appropiate class tags for the style sheet.

    I have read a few scripts where they have said us ^p as a find option but this simply wipes out the whole paragraghs formatting including any lists included.

    Any help on this matter is most appreciated as i have no real idea where to start on this one.
    Cheers

    Dean

    In the beginning god said "let there be light." and from out of the darkness a pen pusher was heard to say "not to much. that's expensive that is!"

  • #2
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Look for Textism at the Wayback Machine and find an old page for the 'Word HTML Cleaner' - it's a php script that sanitizes Word HTML for the web. He used to have it available for download, but has since changed to a subscription basis for use online. Bummer.


  •  

    Posting Permissions

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