@Paul_Wilkins: While clicking on the input radio opening a fancybox, which contains product list, by slecting any product closing the fancybox and populating the product details to the parent page. At that time i am making the radio checked and it shouldn’t be clickable again, but I am unable to prevent that click.
It seems then that the radio button is the wrong choice for the process that you are doing.
Radio buttons inform the user that there are multiple choices from which only once choice is allowed.
Checkboxes however fit your use-case much better, as they are individually either on or off.
Regardless of whether you take this advice to improve the interface for your users, there is an HTML attribute called “disabled” that you can set on form fields, including radio and check boxes, that prevent them from being interacted with again.
Knowing that, a solution now presents itself. Looking at the fancybox documentation (it’s handy stuff that), there are some callbacks such as afterLoad and beforeClose. We can use that to disable the form field, regardless of whether that be a radio button, checkbox, or whatever.
$("#myDiv").fancybox({
afterShow: function preventSecondOpening() {
$("#myDiv").prop("disabled", "disabled");
}
});
Thanks @Moz. It’s nice knowing that there are multiple paths towards a solution.
Ideally the chosen solution is one that most clearly explains why it is being done in the first place.
@Paul_Wilkins: Thanks for you prompt response and solution. Yes there is either case means there are 2 radio buttons of same kind and are belongs to same group to make choice.