Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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;
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript array destructuring last element 
Javascript :: trigger click on first row datatable jquery 
Javascript :: loading react 
Javascript :: object comparison in javascript 
Javascript :: react bootstrap navbar align right buttons 
Javascript :: sweetalert js full code 
Javascript :: footer bottom 
Javascript :: vanilla js http server 
Javascript :: js set 
Javascript :: async promise javascript 
Javascript :: npm paypal express checkout 
Javascript :: Children in JSX 
Javascript :: javascript loop counter 
Javascript :: $out in mongodb 
Javascript :: Ping discord 
Javascript :: generate qr code react 
Javascript :: Destructuring of object in ES6 
Javascript :: scroll btn 
Javascript :: export json to excel in javascript 
Javascript :: angular date pipi locale 
Javascript :: every in javascript 
Javascript :: how to add an event listener to a function javascript 
Javascript :: looping through json array 
Javascript :: javascript check negative number 
Javascript :: moment.js format 
Javascript :: best javascript books 
Javascript :: what does event emitter do in angular 
Javascript :: how to update state.item[1] in state using setState? React 
Javascript :: sort object with certain value at start of array js 
Javascript :: iconify react 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =