Skip navigation
yeungyam
Currently Being Moderated

Link 2 radio button

Apr 5, 2012 8:36 AM

I have a form where if one radio button1 is clicked, radio button2 becomes mandatory. It could also be the opposite, if radio button2 is clicked, then radio button1 becomes mandatory. None of them can also be left blank.

 
Replies
  • Currently Being Moderated
    Apr 9, 2012 4:17 PM   in reply to yeungyam

    In the layoutReady event of the first radiobuttonlist you put (in formcalc):

     

    if ($.isNull == 0 and RadioButtonList2.isNull) then

        RadioButtonList2.validate.nullTest = "error"

    else

        RadioButtonList2.validate.nullTest = "disabled"

    endif

     

    and then you would do the same for the second radiobuttonlist just renaming the lists.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 11:46 AM   in reply to yeungyam

    Radio Buttons are special group of objects.  If your radio button 1 and radio button 2 are in the "same" RadioButtonList then they are set to be a mutually exclusive group therefore one on one off.  Both on and off are valid answers for a RadioButton therefore if set to be required only 1 button is required to be 'on'

    This is likely why you can still submit as off is a valid answer as long as one button in the RadioButtonList is 'on'

     

    For a solution, I would suggest ensuring that your radio buttons are in different RadioButtonLists therefore they are not mutually exclusive group and each would have to be on if it was required.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 3:16 PM   in reply to yeungyam

    add a Textfield, delete the caption and make it invisible.  Then put this on the calculate event:

     

    If (RadioButtonList1.rawValue + RadioButtonList2.rawValue >= "1") then

    RadioButtonList1.mandatory = "error"

    RadioButtonList2.mandatory = "error"

    endif

     

    the vales of the radio buttons have to be numeric for this to work though.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points