$(document).ready(function () { $('#pnlOwnership input[name=\'ownership\']').bind('click', function () { var value = $(this).val(); if (value == 'yes') { // // add mandatory validation // var validationList = $('#pnlExistingPlant .pnlEnterExistingPlantData input').data('validation'); // validationList = 'mandatory,' + validationList; // $('#pnlExistingPlant .pnlEnterExistingPlantData input').data('validation', validationList); // show panel $('#pnlOwnership .pnlEnterOwnershipNotification').hide(); } else { // // remove mandatory validation // var validationList = $('#pnlExistingPlant .pnlEnterExistingPlantData input').data('validation'); // validationList = validationList.replace('mandatory,', ''); // $('#pnlExistingPlant .pnlEnterExistingPlantData input').data('validation', validationList); // hide panel $('#pnlOwnership .pnlEnterOwnershipNotification').show(); } }); });