ASPxClientEdit.SetIsValid(isValid) Method

Sets a value that specifies whether the editor's value is valid.


SetIsValid(isValid: boolean): void


Name Type Description
isValid boolean

True if the editor's value is valid; otherwise, False.


Use the SetIsValid property to manually specify the editor's validity. When the SetIsValid(false) is called, the error message is shown. Note that this doesn't mean that the control is declared as invalid for the all subsequent page postbacks. The next time the validation is called, it will be performed again. If the validation indicates that the editor is valid, the postback will occur.


If you want to declare the control as invalid using a custom code, you can use the Validation client-side event handler:

<ClientSideEvents Validation="function(s, e){ e.isValid = false; }" />


The code sample below demonstrates how you can perform a custom validation without using any predefined validation capabilities. Note that in this case, the ValidationSettings.EnableCustomValidation property should be set to true to show an error frame.

function OnAgeValidation(s, e) {
     var age = tbAge.GetText();
     if (age == null || age == "")
     var digits = "0123456789";
     for (var i = 0; i < age.length; i++) {
          if (digits.indexOf(age.charAt(i)) == -1) {
     if (tbAge.GetIsValid() && age.charAt(0) == '0') {
          age = age.replace(/^0+/, "");
          if (age.length == 0)
               age = "0";

     if (age < 18) {
          tbAge.SetErrorText('Age must be greater than or equal 18');
<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" ClientInstanceName="tbAge">
     <ValidationSettings ValidateOnLeave="False" EnableCustomValidation="True">

<dx:ASPxButton ID="btnValidate" runat="server" AutoPostBack="False" Text="Validate">
     <ClientSideEvents Click="OnAgeValidation" />
See Also