I have a RadEditor with a required field validator. The error message of required field validation disappers only after a post back. It is not disappearing after I enter any text in the radeditor.
I have tried to write a javascript for onblur event and hide the error message. But it is not working as expected in IE8. Once I enter any text, error message is disappearing but if I delete the text and make the radditor blank again, I am not getting the error message again. Thus it is not validating the required fields properly.
The javascript I have written for "onblur" event :
function DisableRequiredMessage(editor, args) {
var element = document.all ? editor.get_document().body : editor.get_document();
$telerik.addExternalHandler(element, "blur", function(e) {
var editor1 = $find("ctl00_ContentPlaceHolder1_ContractExpirationAlertEditor");
var message1 = editor1.get_html();
if (message1 == '<br>' || message1 == '<p> </p>')
document.getElementById('ctl00_ContentPlaceHolder1_spnEmailBody').style.display = 'block';
else
document.getElementById('ctl00_ContentPlaceHolder1_spnEmailBody').style.display = 'none';
});
}
I have also tried comparing length of the text and doin the same :
var editor2 = $find("ctl00_ContentPlaceHolder1_ContractPendingEContractEditor");
var message2 = editor2.get_text();
if (message2.length > 1)
document.getElementById('<%=spnContrPendngEmail.ClientID %>').style.display = 'none';
if (message2.length == 0 || message2.length == 1)
document.getElementById('<%=spnContrPendngEmail.ClientID %>').style.display = 'block';