Hello @ivanpetermann ,
With mask “0000” the code below works. However, I tried to change the mask pattern but actions removeClass and addClass do not work. The code I use is this:
function validation_colors() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("input[type='text']").mask('A', {translation: {'A': {pattern: /[a-zA-Z0-9]/, recursive: true}}}, {
reverse: false,
onComplete: function(val) {
$("div.fieldset-job_title > div.field-head > label").removeClass("invalid-text").addClass("valid-text");
},
onChange: function(val) {
$("div.fieldset-job_title > div.field-head > label").removeClass("invalid-text").addClass("valid-text");
},
onInvalid: function(val, e, f, invalid, options) {
$("div.fieldset-job_title > div.field-head > label").removeClass("valid-text").addClass("invalid-text");
}
});
});
</script>
<?php
}
add_action('wp_footer', 'validation_colors', 10);
Could you please help me find out what is wrong with the pattern ‘A’ that works, but the classes that do not?
Thank you
-
This reply was modified 2 years, 8 months ago by pickme.
-
This reply was modified 2 years, 8 months ago by pickme.