Manoj Maharana

Manoj Maharana

  • NA
  • 362
  • 126.8k

validation javascript(clientside) not working in html editor

Aug 20 2016 7:00 AM
function ValidateFrom() {
debugger;
var editor1 = $find("<%=Editor1.ClientID%>");
var content1 = editor1.get_content();
if (content1.trim() == "") {
document.getElementById("<%=divDesMsg.ClientID %>").innerHTML = "Please enter Description.";
document.getElementById("<%=divDesMsg.ClientID %>").style.display = 'block';
document.getElementById("<%=Editor1.ClientID %>").focus();
return false;
}
}
 
here i am checking value is available or not:
<script>
function checkfunction(val) {
if (val != "") {
document.getElementById("<%=divDesMsg.ClientID %>").style.display = 'none';
}
 
here is editor:
<div id="divDesMsg" runat="server" style="color: Red;">
</div>
<label>
Description: <em>*</em></label>
<div>
<HTMLEditor:Editor ID="Editor1" runat="server" onkeyup="checkfunction(this.value)" Height="300px" Width="500px" AutoFocus="true"
NoUnicode="false" />
</div>
<div class="clear"></div>
 
The problem is that while checking the value it will show error message...but after fill up the text in editor lable shows ..
 
i want to disappear the level after checking when value is available in html editor 

Answers (2)