Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5371 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted

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.

  • 7 months later...
Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.