Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

if condition for radio button using jQuery

by
Category:javascript
php javascript jquery
if condition for radio button using jQuery

I need to find out if radio button is checked using jQuery. I was knowing one way to find out but there are couple of other ways as well to find out if radio button is checked using jQuery. You may also like How to checkbox checked using jQuery and How to radio button checked using jQuery.

HTML Code

<div class="col-md-12">
    <label class="col-sm-2 label-on-left" style="text-align: left;">QR Manager Send Mail
            <input type="radio"  value="1"      required     name="mailSendManager" class="mailSendManager" style="margin-left: 10px;"></label> 
    <label class="col-sm-2 label-on-left" style="text-align: left;">HR Manager Send Mail
            <input type="radio"  value="2"  required      name="mailSendManager" class="mailSendManager" style="margin-left: 10px;"></label> 
    <label class="col-sm-2 label-on-left" style="text-align: left;">Dev Manager Send Mail
            <input type="radio" value="3"  required     name="mailSendManager" class="mailSendManager"  style="margin-left: 10px;"></label> 
</div>

Jquery Code

var getradio = $('.mailSendManager:checked').val();
if(getradio != undefined)
{
   alert('Success');
}
else
{
   alert('Not Success');
}

0 Comments


Html code work in comment box


Related Post