0

$('textarea[name="textarea16"]').keyup(function() {
    if(isUrl($(this).val())){
       $('input[type="submit"]').attr('disabled', true);
    }else{
        $('input[type="submit"]').removeAttr('disabled');
    }
});
function isUrl(s) {
    var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
    return regexp.test(s);
}

Jagdish Sarma Asked question May 20, 2021
Add a Comment