How to check if a radio buttons inside asp:repeater is checked or not using javascript/jquery?
I have defined two radio buttons('Yes','No') in asp:repeater. Which are dynamic at run time, meaning that if the database returns 5 questions then for every question we have option ('Yes','No'). The image attached shows the existing design of the radio buttons
Now i want to validate these radio buttons defined in asp:repeate to check if the radio buttons is checked or not using javascript/jquery. Below is the code:
Salman BegPosted Feb 20, 2019, 8:29 AM
Ansh SaxenaPosted Feb 20, 2019, 7:44 AM
Salman BegPosted Feb 20, 2019, 7:09 AM
Ansh SaxenaPosted Feb 20, 2019, 6:56 AM
Thanks for your help. I have created the below function but is not working i.e. every time if the button is checked or not the output is “inside, if condition false”:
function checkRadio() {
alert("inside checkradio");
if ($("rbYes").attr("checked", false))
{
alert("inside, if condition false");
return false;
}
if ($("rbYes").is(":checked", true))
{
alert("inside, if condition true");
return true;
}
}
Salman BegPosted Feb 17, 2019, 12:11 AM