I have several forms, which when submitted, send their data (: radio) to a function that is responsible for checking that all radios of that form in question are selected.
In the function, it is assigned to a variable which is the form in question (it comes from a function that checks which is the propagation of the event). I leave you a fragment of the function:
var validarRadios2 = function(data) {
var formAValidar;
if(data==1){
formAValidar=elementosForm1;
}else if(data==2){
formAValidar=elementosForm2;
}else if(data==3){
formAValidar=elementosForm3;
}else if(data==4){
formAValidar=elementosForm4;
}else{
formAValidar=elementosForm5;
}
//var opciones = formAValidar.('radioButtons');
}
My question is: In the last line of code (which is wrong, but I guess it should be something similar to that), how can I select the radio buttons of a form that has been saved in a variable?!
I feel if it's a simple question, but I really do not know how it is done and I would really appreciate a help.