Hi Mihael,
Thanks for contacting us.
Yes , you can display confirmation dialog through change event of RTE, when RTE is edited and its value is changed. If you wish you to check for certain keypress and display a confirmation dialog , then you can perform this using keyDown event of RTE. Kindly refer the following code.
@{Html.EJ().RTE("rteSample").ClientSideEvents(e=>e.Keydown("onKeyDown").Change("onChange")).Width("100%").Height("380px").ContentTemplate(@<div>
<p><b>Description:</b></p>
<p>
The Rich Text Editor (RTE) control is an easy to render in
client side. Customer easy to edit the contents and get the HTML content for
the displayed content. A rich text editor control provides users with a toolbar
that helps them to apply rich text formats to the text entered in the text
area.
</p>
</div>).MinWidth("200px").Render();}
<script>
function onChange(args) {
console.log(args.value)
}
function onKeyDown(args) {
if (args.keyCode == 17) {
var check = confirm("Please click OK for navigation to demo page.")
if (check)
}
}
</script> |
We have attached a sample for your reference, please find the sample at the following location:
For further reference on the available events in RTE, please refer the following UG document
Note: In our sample, we have just displayed a confirmation dialog to show alert before navigating from the anchor link. You can also render our Syncfusion Dialog with required content for this case and show or hide through show/hide methods based on the requirement. Kindly refer to the below UG documentation links:
Let us know if you need any further assistance on this.
Regards,
Prince