August 5, 200916 yr 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?
August 5, 200916 yr 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
August 5, 200916 yr 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
August 6, 200916 yr 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.
March 12, 201015 yr 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?
Create an account or sign in to comment