loboo19 loboo19 - 1 year ago 56
jQuery Question

jQuery Phone Validation dosen't work after refresh page

I have script

var phoneInput = $('.custom-options').val(372);
var inputCart = $('.wc-variation-selection-needed');

phoneInput.keyup(function() {
if (!phoneInput.val().match(/^372\d{8}$/)) {
} else {

this work, but only once, if i click the button and send form, inputCart will be still enable.

Answer Source

That would be a good practice to use prop("disabled", true) and prop("disabled", false) to enable/disable the element