hi i want to enable the the checkboxes again if user has uncheck the checkboxes which was checked. however in my case case the id and name of the element should to be same. checkboxes are getting disabled on the basis of their values and in the same way i want to enable them back...
<input type="checkbox" value="1" id="preferenceid" name="preferenceid">
<span>MBA</span>
<input type="checkbox" value="2" id="preferenceid" name="preferenceid">
<span>Integrated MBA</span>
<input type="checkbox" value="3" id="preferenceid" name="preferenceid">
<span>MBA/PhD</span>
<input type="checkbox" value="4" id="preferenceid" name="preferenceid">
<span>Diploma</span>
<input type="checkbox" value="5" id="preferenceid" name="preferenceid">
<span>BA(Mass Communication)</span>
<input type="checkbox" value="6" id="preferenceid" name="preferenceid">
<span>BBA</span>
<script type='text/javascript'>
$('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').click(function () {
$('#preferenceid[value="5"],#preferenceid[value="6"]').attr("disabled",true);
});
$('#preferenceid[value="5"],#preferenceid[value="6"]').click(function () {
$('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').attr("disabled",true);
});
if($('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').attr('checked')) {
$('#preferenceid[value="5"],#preferenceid[value="6"]').attr("disabled",true);
}
if($('#preferenceid[value="5"],#preferenceid[value="6"]').attr('checked')) {
$('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').attr("disabled",true);
}
</script>
spanelements would be better expressed aslabel(with appropriateforattributes)