Page 1 of 1

require selection radio button

Posted: Fri May 16, 2014 12:01 pm
by Brian Irr

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?


require selection radio button

Posted: Fri May 16, 2014 1:07 pm
by Kateryna Grynko

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.


require selection radio button

Posted: Fri May 16, 2014 2:07 pm
by Brian Irr

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


require selection radio button

Posted: Fri May 16, 2014 5:08 pm
by Evgene Karachevtsev

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


require selection radio button

Posted: Fri May 16, 2014 5:15 pm
by Brian Irr

thank you that worked...