After searching for information on the Internet, it seems that it is a problem. The original Article is as follows:
With ASP. NET, I need to submit twice when using the requiredfieldvalidator IN A FCKeditor instance
FCKeditor will not work properly with the required field validator when the "enableclientscript" property of the validator is set to "true" (default ). due to a limitation in the default validation system, you must set it to "false ".
If you want to do client side validation, you must use a custom validator instead and provide the appropriate validation function, using the FCKeditor javascript API.
The translation is as follows (the translation is not good and everyone can understand it ):
Q: Why do I need to submit it twice when using ASP. NET requiredfieldvalidator?
A: When the enableclientscript attribute of requiredfieldvalidator is set to true, FCKeditor does not support requiredfieldvalidator. To remove this restriction, you must set this attribute to false. If you want to use client verification, you must use M validator to create a non-empty verification to replace requiredfieldvalidator, where you can use the FCKeditor javascript API.
Read this articleArticleI went to the FCKeditor javascript API documentation and found that it provides some attributes and methods for client JavaScript calls, according to the above answer, I wrote a Javascript script to complete the verification.
Detailed solution: First add a Javascript script:CopyCodeThe Code is 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 and set clientvalidationfunction = "customvalidate". Do not forget validateemptytext = "true", otherwise it will not work!
In this way, try again. OK, you can submit it directly once, and there will be no bugs submitted twice.