uncheck radio button on second click jquery
<div class="col-md-3">
<div class="form-group" >
<label for=" " class="ProLabel1">Stage</label>
<div class="ProInput1">
<input type="radio" onclick="preshow()" name="prepost" value="pre" >Pre Chargesheet
<input type="radio" onclick="postshow()" name="prepost" value="post">Post Chargesheet
</div>
</div>
</div>
<script>
$(function(){
$('input[name="prepost"]').click(function(){
var $radio = $(this);
// if this was previously checked
if ($radio.data('waschecked') == true)
{
$radio.prop('checked', false);
$radio.data('waschecked', false);
}
else
$radio.data('waschecked', true);
// remove was checked from other radios
$radio.siblings('input[name="rad"]').data('waschecked', false);
});
});
</script>
Download Code Sample
Image popup on page load using HTML and jQuery
ReplyDeleteBootstrap modal popup example on page load
Ajax live data search using jQuery PHP MySQL
How to fetch data from database in PHP and display
How to insert image in database using PHP
Difference between tuple and list in Python
Bootstrap datepicker example
Bootstrap star rating input example
PHP Fix: invalid argument supplied for foreach