After looking up the information on the Internet, it appears that it is a problem of its own, the original text is as follows:
with ASP.net, I need to submit twice if using the RequiredFieldValidator in a FCKeditor instance
FCKeditor won't work properly with the Required Field Validator the ' enableclientscript ' property of the Validator is set to "true" (default). Due to a limitation into the default validation system, you must set it to "false".
If you are want to do client side validation, your must use a Custom Validator instead and provide the appropriate validation F Unction, using the FCKeditor JavaScript API.
The translation is not good, you can read it well:
Q: Why do I need to submit two times when using ASP.net's RequiredFieldValidator
A: When RequiredFieldValidator's EnableClientScript property is set to True, FCKeditor does not support RequiredFieldValidator very well, in order to remove this limitation, You have to set this property to False. If you want to use client-side authentication, you must use custom validator to make a non-empty validation to replace RequiredFieldValidator, where you can use FCKeditor JavaScript API can be.
After reading this article, I went to the documentation for the FCKeditor JavaScript API and found that it provided some properties and methods for the invocation of client JavaScript, and then wrote a JavaScript script to complete the validation with the answer.
Detailed workaround: Add JavaScript Script first:
Copy Code code as follows:
Script language= "javascript" type= "Text/javascript" >
var oediter;
function customvalidate (source, arguments)
{
var value = oediter.getxhtml (true);
if (value== "")
{
Arguments. IsValid = false;
}
Else
{
Arguments. IsValid = true;
}
}
function Fckeditor_oncomplete (editorinstance)
{
Oediter = editorinstance;
}
</script>
' Then add CustomValidator, set clientvalidationfunction= ' Customvalidate ', and be careful not to forget validateemptytext= ' True ', otherwise it won't work!
In this way, try again, OK, can be submitted directly at one time, there will not be a bug submitted two times