I created a simple HTML form with only one radio button:
<section id="section1" sectionTag="section" headerStyle="title" headerCode="My Section">
Radio button 1
<obs conceptId="1646" style="radio" answers="Answer #1,Answer #2,Answer #3" />
The form can only be submitted when the first option of the radio button is selected. Whenever I choose another option than the first one, the submit button is greyed out and the form can’t be submitted.
Step 1 I tick another option than the first one:
Step 2 No data is ‘read’, and the empty form can’t be submitted:
I don’t see anything in the log, but that looks 100% client-side anyway.
Any help would really be appreciated.
We haven’t used radio buttons much in the new(ish) one question per screen flow that you are using, so it’s certainly possible there is a conflict with it. I’m on vacation now, but hopefully someone else will be able to take a look–otherwise, I’ll try to take a look when I get a chance–feel free to ping me to remind me!
Thanks for coming back to me so quick. This is not urgent since we can use a dropdown menu instead for the time being, but it would be great if you could look into it eventually.
Otherwise, could you maybe point me out towards where to look for debugging?
I was guessing that I could debug calls to
but I am really not sure where to look. The one instance of this call that I find is in
and the breakpoint is never reached, so I’m clearly looking in the wrong place.
The underlying issue has to do with the Simple Form UI whose code is here.
Basically, the UI only correctly handles a single input element per field, so there is some code that doesn’t recognize that you’ve selected anything. If you had added another non-radio field/question and given it an answer, I expect that you would not be blocked from submitting, and things would work fine after submission (but the confirm screen would show a blank value for the radio question).
The reason that nobody has bothered to fix this yet is that radio buttons work badly with this question-per-screen UI, so you’re better off avoiding them in the first place. I suggest doing a select where you specify size=“3” (or, however many options you have) as this works pretty nicely for both keyboard and mouse usage.
Hope this helps! Feel free to edit the wiki page about Simple Form UI to mention this issue somehow.