I should add that I have resolved this by replacing the __doPostBack function to add my test. I just wonder if there is a way to do this without this extra code.
$(document).ready(function () {
var originalDoPostBack = __doPostBack;
__doPostBack = function (target, args) {
if (hasBadContent(editor.get_html(false))) {
return;
}
originalDoPostBack(target, args);
}
0
Ianko
Telerik team
answered on 28 Mar 2014, 09:43 AM
Hello Dan,
The proper approach is using a CustomValidator control, which cancels the submit upon to implemented logic. The editor by itself cannot cancel the submitting and such behavior would be faulty.
I suggest examining this live example which demonstrates the integration of the CustomValidator with the RadEditor control.