Radio Button: There are three Radio buttons('radio1','radio2

Radio Button:
There are three Radio buttons('radio1','radio2' and 'radio3') as required fields in a form. Based upon the selection of 'radio1' either 'radio2' or 'radio3' should be shown. This I have done by javascript. But as the radio buttons are required fields, the hidden radio button is not allowing to submit the form. Can any one help me how to set null value for the hidden radio button(which is required field). Thanks in advance.

OriginalPostID-148241

OriginalPostID-148241

  Discussion posts and replies are publicly visible

Parents
  • This is the js I am using,
    var radVal = FormAPI.getValue("radio1").id;
    if(radVal=="AGGREGATED")
    {
    FormAPI.show("radio2");
    FormAPI.hide("radio3");
    FormAPI.setRequired("radio3",false);
    }
    else
    {
    FormAPI.show("radio3");
    FormAPI.hide("radio2");
    FormAPI.setRequired("radio2",false);
    }

    But form is not allowing to submit. Showing a validation message{required field cannot be empty} to radio button(which is hidden).
Reply
  • This is the js I am using,
    var radVal = FormAPI.getValue("radio1").id;
    if(radVal=="AGGREGATED")
    {
    FormAPI.show("radio2");
    FormAPI.hide("radio3");
    FormAPI.setRequired("radio3",false);
    }
    else
    {
    FormAPI.show("radio3");
    FormAPI.hide("radio2");
    FormAPI.setRequired("radio2",false);
    }

    But form is not allowing to submit. Showing a validation message{required field cannot be empty} to radio button(which is hidden).
Children
No Data