NetTalk Central

Author Topic: HTML text not displaying in view form  (Read 3879 times)

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
HTML text not displaying in view form
« on: January 20, 2024, 11:44:27 AM »
Hi,

I have a Text field on a NetWebForm. I have the Redactor HTML editor enabled and it edits it correctly. I can also view the formatting when in edit mode.

But when the NetWebForm is called in View mode, the Text field displays the HTML tags instead of displaying it with the HTML formatting. The field is set as "Allow xHTML".

What should I do for the HTML formatting to display correctly in view mode?

Thanks
&
Regards,
Ubaidullah Nubar.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: HTML text not displaying in view form
« Reply #1 on: January 21, 2024, 10:43:27 PM »
check and see (in debugview++, on the server) if the HTML is considered to be "unsafe".

Since you are getting user input here, and then displaying it, it would be very unwise to allow unsafe HTML - which in turn means (if it is unsafe) it is rendered as text.

cheers
Bruce

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: HTML text not displaying in view form
« Reply #2 on: January 22, 2024, 06:03:26 AM »
Thanks. That was it.

There were <bold> tags that are considered unsafe.

So, what is the recommended way to display text that is entered via the editors? Is it possible to display the editor in read-only mode?

The use case is that some users can edit descriptions with formatting using the editor. Other users should be able to only view the formatted text. This is obviously user-generated content so I wouldn't want to allow unsafe HTML as you recommend but at the same time need to allow users to view the text correctly.

Regards,
Ubaidullah Nubar.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: HTML text not displaying in view form
« Reply #3 on: January 23, 2024, 06:30:14 AM »
are you sure it said <bold> ?
HTML doesn't have a <bold> tag.
(If you are getting that in the html then we could add it as a "safe" tag, but it's not a normal tag.)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: HTML text not displaying in view form
« Reply #4 on: January 30, 2024, 08:03:37 AM »
Hi,
I think I have similar issue.
In the end I used the NetTalk Demo App (Web Client) and noticed that the server returned a 10061 errorcode.
Not to sure what to do about that though.

Regards,
Rene
Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: HTML text not displaying in view form
« Reply #5 on: January 30, 2024, 10:01:55 PM »
that's a very different error, and unrelated to this hread. Start a new thread with that question Rene.

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: HTML text not displaying in view form
« Reply #6 on: January 31, 2024, 01:18:07 AM »
Ok Bruce,
I will prepare an example first.
Ren?
Rene Simons
NT14.14