Missing onclick javascript in dialog content

Hi,

I am ajaxing html content into my dialog control and some of the links within the html contain onclick javascript attributes. However, when the dialog is rendered on the page the onclick attributes are no longer there. Is this expected behavior and if so is there a way I can make sure the javascript is retined within the dialog?

Below are screenshots of the html as it is set as dialog.content with the onclick present and then one of the rendered html with the onclick missing.

Any help would be appreciated.

thanks

adam











3 Replies 1 reply marked as answer

IS Indrajith Srinivasan Syncfusion Team November 30, 2020 05:08 AM UTC

Hi Adam,  
  
Greetings from Syncfusion support,  
  
We have validated your reported query. The onclick event is removed due to the prevention of cross-scripting site with HTML, when passing it to the content of the dialog. In order to resolve this, we suggest you to disable the enableHtmlSanitizer property in the dialog.  
  
  
  
Please let us know if the solution helps, 
  
Regards,  
Indrajith  


Marked as answer

AT Adam Toone November 30, 2020 09:13 AM UTC

That's worked perfectly..thanks so much.

adam


IS Indrajith Srinivasan Syncfusion Team December 1, 2020 03:59 AM UTC

Hi Adam,

Welcome,

Please let us know if you need any further assistance.

Regards,
Indrajith

Loader.
Up arrow icon