Back to Devexpress

ASPxClientEdit.ValidateGroup(validationGroup) Method

aspnet-js-aspxclientedit-dot-validategroup-dot-static-x28-validationgroup-x29.md

latest2.6 KB
Original Source

ASPxClientEdit.ValidateGroup(validationGroup) Method

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

Declaration

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

Parameters

NameTypeDescription
validationGroupstring

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

TypeDescription
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.

aspx
<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

Validation

ValidateEditorsInContainer.static

ValidateEditorsInContainerById.static

How to: Validate a Group of Editors

How to: Validate an Editor

ASPxClientEdit Class

ASPxClientEdit Members