WilliamCB Posted August 5, 2009 Posted August 5, 2009 Is there a simple way to strip all html tags from a piece of text held in a text field, so that you are left with just the text that is not enclosed by any tag?
Søren Dyhr Posted August 5, 2009 Posted August 5, 2009 If it really can be regarded as simple, is a good question - but a friend of mine have done this: http://www.briandunning.com/cf/522 But beware, dependencies exists to two other CF's... --sd
Lee Smith Posted August 5, 2009 Posted August 5, 2009 The CF will not let you close the CF Edit box until you replace the Fields used, System::String1 and System::String2, with your own TO name. i.e. if your TO name is Contact, they would need to be changed to Contact::String1 and Contact::String2. HTH Lee
fseipel Posted August 6, 2009 Posted August 6, 2009 I'm not sure if this is applicable to your situation, but if the HTML is in a webviewer initially, setting the URL to javascript:a=document.body.innerHTML;var mydiv = document.createElement("div");mydiv.innerHTML=a;document.content=mydiv.innerText; will strip all tags from it and return the results to the webviewer from which it can be read into a field. You can alternately strip the tags using a regular expression within the JS; if you place text from a field into the webviewer, this allows the regex to be operate on that text. Since FM has no inbuilt regex support this simplifies some more complex text manipulations. I tried removing tags from HTML a couple years ago with a script, but it was very slow for long documents -- but then, my script might have been inefficient.
andries Posted March 12, 2010 Posted March 12, 2010 the above stated method does not seem to work for me. My webviewer keeps on loading the javascript:a.... request/url. Is there something I am doing wrong?
Recommended Posts
This topic is 5371 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now