[Solved] How can I validate a regular expression using jQuery Validation plugin?

No need for jQuery. Use the RegExp constructor and catch the exception : try { new RegExp(someString); console.log(‘good’); } catch (e) { console.log(‘bad’); } Demonstration (type something in the input to know if it’s a well formed regular expression) 2 solved How can I validate a regular expression using jQuery Validation plugin?

[Solved] jQuery Custom validation

From the plugin docs, it appears all you need is a required dependency callback $(selector).validate({ rules:{ Name:{ required: function(element){ return $(“#ID”).val() == 1 && $(“#IDName”).val() == 0; } }, messages:{ Name:{ required: ‘Enter an individual.’} } }) 3 solved jQuery Custom validation

[Solved] How can I set data-* attributes on the button when the AJAX requests complete?

Use jquery data instead: $(“#submitForm”).data(‘transaction’, transactionID); And var number_id = $(“#submitForm”).data(‘transaction’); Notice that this will not add the attribute to the DOM, if you inspect the element via the developers tool, you won’t see data-transaction, but the element will have the data referenced. Edit: Your method should also work, but as @Tushar pointed out, you … Read more

[Solved] jQuery Validate plugin : Only one field required out of multiple [closed]

1) As per the question you’ve linked, I constructed this jsFiddle using the depends option and still see lots of issues. The rules do not seem to work at all, where both fields are always required. 2) There is a require_from_group rule included in the additional-methods.js file. The two fields must have the same class … Read more

[Solved] Using custom CSS with jQuery validation? [closed]

Introduction Write an introduction on Using custom CSS with jQuery validation? [closed] Solution Code Solution Using custom CSS with jQuery validation? [closed] There is an option for jQuery Validate called errorClass: Use this class to create error labels, to look for existing error labels and to add it to invalid elements. All you need to … Read more