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.
No further assistance is required. My fix above works for now. Thank you.
Hello,
I'm just following up to see if you need any further assistance until the release with this fix rolls out.
Hi Kristopher, the answer is as simple as it is - the client-side object models for the IG controls are exposed to provide flexibility and allow developers to create significant functionality on the client, without the need for server-side post-backs. Also, there is a chance that you do not want your app to depend on any libraries.
Apart from the WebMaskEditor, other controls contain not only value, but text or render html inside the element that contains them. In this case using jQuery .val() will not be the best way to get some value.
Please let me know if you have further questions.
Why do you suggest using .NET AJAX over using jQuery?
Hi Christopher,
I have created a support case for you with an ID of CAS-155895-L0V2L2. The issue has been logged in our internal tracking system with ID: 194197. The next step will be for a developer to review my investigation and confirm my findings or to offer a fix, or other resolution
I will leave this case open and update you with any new information after the review. You can also continue to send updates to this case at any time.
Please let me know if you have any questions.