NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Ubaidullah on January 20, 2024, 11:44:27 AM

Title: HTML text not displaying in view form
Post by: Ubaidullah 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.
Title: Re: HTML text not displaying in view form
Post by: Bruce 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
Title: Re: HTML text not displaying in view form
Post by: Ubaidullah 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.
Title: Re: HTML text not displaying in view form
Post by: Bruce 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.)
Title: Re: HTML text not displaying in view form
Post by: Rene Simons 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
Title: Re: HTML text not displaying in view form
Post by: Bruce 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.
Title: Re: HTML text not displaying in view form
Post by: Rene Simons on January 31, 2024, 01:18:07 AM
Ok Bruce,
I will prepare an example first.
Ren?