Hi,
Im using FCK Editor control instead a textarea element. I installed it without problems.
But when i want to validate it with a Custom validator of ASP.Net 2.0, im not getting the result expected.
These lines are the code that i have:
<textarea style="width:30px;height:20px;" class="ckeditor" id="txtdescription" runat="server" name="txtdescription" cols="5" rows="10"></textarea>
<asp:CustomValidator id="descval" runat="server" ControlToValidate="txtdescription" EnableClientScript="true" Enabled="true" ValidateEmptyText="true" Display="Dynamic" ClientValidationFunction="ValidateTextDesc" Text="*" ErrorMessage="*"/>
<asp:Button ID="buttonadd" runat="server" Text="Add text" OnClick="buttonadd_Click" />
And my javascript code that executes the CustomValidator client function is:
function ValidateTextDesc(source, args)
{
var descriptiontext = document.getElementById("txtdescription");
if ((descriptiontext.value.indexOf("<script") != -1) || (descriptiontext.value.length==0))
{
args.IsValid=false;
}
else
{
args.IsValid = true;
}
return args.IsValid;
}
My problem is that i have to click twice my submit button to execute this Client function:
Do you know why this issue is happening? Thanks in advance. Regards. Josema.