asp.net fckeditor custom non-null validation _ Practical Tips

Source: Internet
Author: User
It needs to be submitted two times before it can be passed. The workaround is to disable the client-side scripting validation feature of the RequiredFieldValidator control. Validation is only on the server side.
Copy Code code as follows:

<asp:requiredfieldvalidator id= "RequiredFieldValidator16" runat= "controltovalidate=" FCK "display=" Dynamic "enableclientscript=" False "errormessage=" not yet filled in ></asp:RequiredFieldValidator>

Today, when looking for information, there is a chance to see a new solution. The above bug can be resolved by using the method provided by FCK to use the CustomValidator control. In the client use JS to do FCK verification.
Code
Copy Code code as follows:

FCK non-null validation
var oediter;
function fckvalidate (source, arguments)
{
var value = oediter.getxhtml (true);
if ($.trim (value) = "")
{
Arguments. IsValid = false;
}
Else
{
Arguments. IsValid = true;
}
}
function Fckeditor_oncomplete (editorinstance)
{
Oediter = editorinstance;
}

Copy Code code as follows:

<asp:customvalidator id= "CustomValidator1" runat= "Server" display= "Dynamic" errormessage= "not filled out" clientvalidationfunction= "Validtitle" onservervalidate= "VALIDFCK" controltovalidate= "FCK" ></asp: Customvalidator>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.