if ($('#phone_inp').val().length){ var ph = $('#phone_inp').val().replace(/[^0-9.]/g, ""); if(ph.length == 11) {