Brian Irr
Posts: 0
Joined: Tue Sep 17, 2013 1:25 pm

require selection radio button

I have three radio buttons called radiogroup, I would like to have an alert if one of them have not been selected stating "you must select one" and then if one has been selected to call a function called claculate.

any ideas how to write this?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

require selection radio button

Hi Brian,

Check if you select radio value: preif (!Apperyio("mobileradiogroupName").find(":checked")){
alert("you must select one");
}/pre
Then run calculate function:preApperyio("mobileradiogroupName").find("input").each(function(){$(this).on("change", calculate);});/preWhere mobileradiogroupName is a name of mobileradiogroup component.

You can run this code on page Load event.

Brian Irr
Posts: 0
Joined: Tue Sep 17, 2013 1:25 pm

require selection radio button

I added the check if selected code with onclick event to the button on the page with no results.

any ideas?

I changed the mobileradiogroupName to radiogroup The name if the group. Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

require selection radio button

Hello Brian,

We advise that you use such javascript code:

codeif (Apperyio("radiogroup").find(":checked").length == 0){
alert("you must select one");
}else{
/&#47
} /code

Brian Irr
Posts: 0
Joined: Tue Sep 17, 2013 1:25 pm

require selection radio button

thank you that worked...

Return to “Issues”