Answers for "jquery determine empty value radio by name"

0

jquery determine empty value radio by name

$("form").submit(function () {
    var flag = true;
    $(':radio').each(function () {
        name = $(this).attr('name');
        if (flag && !$(':radio[name="' + name + '"]:checked').length) {
            alert(name + ' group not checked');
            flag = false;
        }
    });
    return flag;
});
Posted by: Guest on December-17-2020

Code answers related to "jquery determine empty value radio by name"

Code answers related to "Javascript"

Browse Popular Code Answers by Language