NetTalk Central

Author Topic: Accidental HTML  (Read 2706 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Accidental HTML
« on: April 08, 2013, 01:27:20 PM »
Hi
I have plain text from a database field that I wish to insert HTML within the text for display purposes. Before I do that, I will need to translate the plain text to convert any accidental HTML ( e.g. '< ', accented characters, etc) in the text to show as the intended on the web page. Is there a web handler method (p_web) that will return a converted string to view as is on a web page?  then I will add my HTML to be displayed on a Display field that allows HTML.

Thanks Rob

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Accidental HTML
« Reply #1 on: April 08, 2013, 08:15:11 PM »
there is indeed.
the WebServer ._jsok method does this.
The easiest way to call this though is via the .Translate method.
ie

whatever = p_web.Translate(whatever)

that takes care of some internal machinations that must occur.

Cheers
Bruce