Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
WebMastEditor and .NET validation: WebMaskEditor control getting a ":v:" append to name on client side.
posted

Hello,

I am having a problem with the WebMaskEditor and .NET's intrinsic validators.  It appears that jQuery is trying to reference the WebMaskEditor with a ":v:" appended to the control name.  Example code:

<ig:WebMaskEditor ID="wmeZipCode" runat="server" InputMask="00000" />
<asp:CustomValidator ID="cuvWmeZipCode" runat="server" ErrorMessage="Please enter your five digit zip code." Text="" Display="None" CssClass="validatorMessage" EnableClientScript="true" ControlToValidate="wmeZipCode" ClientValidationFunction="wmeZipCode_ClientValidate" OnServerValidate="wmeZipCode_ServerValidate" ValidateEmptyText="true" />

When the client side validation executes I get the error: DOMException: Failed to execute 'querySelectorAll' on 'Document': '#wmeZipCode:v:' is not a valid selector.

Does anyone have any idea why this is?   I don't believe I have any other javascript that is interfering with this.  My custom validator client script is really simple:

function wmeZipCode_ClientValidate(sender, e) {

var pattern = new RegExp(/^\d{5}$/);
e.IsValid = pattern.test($('#<%=wmeZipCode.ClientID %>').val());
}

Thank you for your assistance.

Parents Reply Children
No Data