Skip to main content

ASPxClientEdit.ValidateGroup(validationGroup) Method

Performs validation of editors contained within the specified validation group, dependent on the editor visibility state specified.

Declaration

static ValidateGroup(
    validationGroup: string,
    validateInvisibleEditors?: boolean
): boolean

Parameters

Name Type Description
validationGroup string

A string value specifying the validation group’s name.

validateInvisibleEditors boolean

true to validate both visible and invisible editors that belong to the specified validation group; false to validate only visible editors.

Returns

Type Description
boolean

true if editors of the specified validation group pass validation; otherwise, false.

Remarks

This method allows you to programmatically perform client-side validation of editors belonging to a specific validation group.

Note

If the validationGroup parameter is set to null, the method validates all/visible (under the validateInvisibleEditor parameter value) editors on a page.

<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px">
     <ValidationSettings ValidationGroup="MyGroup" ValidateOnLeave="False">
          <RequiredField IsRequired="True" ErrorText="Field is required" />
     </ValidationSettings>
</dx:ASPxTextBox>
<dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px">
     <ValidationSettings ValidationGroup="MyGroup" ValidateOnLeave="False">
          <RequiredField IsRequired="True" ErrorText="Field is required" />
     </ValidationSettings>
</dx:ASPxTextBox>
<dx:ASPxButton ID="btn" runat="server" Text="Validate" AutoPostBack="False" CausesValidation="False">
     <ClientSideEvents Click="function(s, e) {
          ASPxClientEdit.ValidateGroup('MyGroup');
     }" />
</dx:ASPxButton>
See Also