The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Required from a Group

Labels

This Discussion is public

Notifications

I would like to have a number of scenarios and offer 4 options for taking action on each.

Each option corresponds to a particular behaviour type - so I can then use Saved Values and Number field calculations to calculate how many times a particular type of behaviour was chosen.

For each scenario, there is also a correct answer and I would like to calculate how many correct answers were chosen. I could do this if there was the option of having 2 saved values for a field but as that isn't available, I thought this approach would work:

For each scenario, offer 4 separate options (single radio buttons) - because they are separate fields, I can do my 'correct' calculation.

The problem with this is, how do I enforce that one and only one option from the 4 radio buttons is selected. In my mind it means grouping the 4 radio buttons and having a required / only one from the group.

Is this possible - or is there a better approach.

thanks for any assistance 🙂

Maybe I'm missing something, but I'm not seeing the logic in using 4 individual radio buttons and calling it a group instead of 1 true radio button group with 4 options. It sounds to me like you're over complicating things.

Nevertheless, to disable the other radio buttons when one is selected requires you to use jQuery to loop through the unselected options and disable them, this also means a user won't be able to change their mind and make another choice unless you give them a way to clear/reset the radio button set.

Thanks - I would like them to be able to change their minds.

The reason for the 4 individual buttons is because if they are part of a group, I can only access 1 variable for scoring. So if option 1 in a particular scenario is the equivalent of behaviour type A, if that is selected I can use a number field calculation to add it to the behaviour type A score.

But, unless there is a way to reference a particular radio button in a group, I cannot also calculate the total number of correct answers - eg [1,2] + [2,4] - where [question,radio button number].

I am sure there must be a more elegant way to do it.

You can use separate values with radio buttons where the text and value are different. You also use the radio button group's checked attribute to get the value.

I showed another poster in this thread http://community.formidableforms.com/help-desk/get-radio-button-option-label-instead-of-value/ how to access the label (text) for the radio button.

Thank you again; I really appreciate your help

Is there a way to convert text into a number that I can plug into a calculation.

For instance, if I have a group of 4 radio buttons and the saved values are:

correct - 1

beta - 0

gamma - 0

theta - 0

If the first button, correct is selected, I can use a number field to add the '1' value to a total. Is it then possible to take the text - 'correct' and do a validation, so that if the text = 'correct', 1 is added to a number field?

If the user selected button 2, the value 0 would be added to a total for that type of behaviour and since the text does not = 'correct', 0 would be added to the correct total.

So at the end of 12 questions, I could know how many times a correct answer was selected?

The form data is stored in the database, all numbers are stored as text. How you convert text to numbers depends on where you're converting them and the language you're using.

To be perfectly honest, you could probably save yourself a lot of time and energy if you consider bringing a developer into the project for a few hours. It's very difficult answering your questions when you're the only one that understands the context in which they're being asked as well as the full requirements. It's really hard to provide guidance without a clear picture.

Thanks for your help - I appreciate that without context it was always going to be a challenge; it was for me trying to explain it! I may put this on the back-burner for a while and come back to it.

thanks again.

Discussion closed.