Skip to main content
Participant
March 29, 2024
Answered

How to have one instance of a radio group be read only and the other editable?

  • March 29, 2024
  • 1 reply
  • 941 views

I have a form that's set up like a quiz, and to make the answers easier to tally, I doubled the groups on the answer key and made it so the buttons are selected on both so the user doesn't have to keep flipping back to the questions to compare their answers. I want them to be able to edit their answers to the questions but not the answer key. Is there a way to make the answer key versions of the groups read-only, but the question groups selectable whilst still having the groups and selections doubled on the answer key?

This topic has been closed for replies.
Correct answer try67

Not possible if they have the same name. You need to give the second group a unique name and populate it using a script. The best way (IMO) is to use the calculation event of a (hidden) text field. Say the first group is called Answer1 and the second is Key1. You could use the following code for them:

this.getField("Key1").value = this.getField("Answer1").value;

 

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 29, 2024

Not possible if they have the same name. You need to give the second group a unique name and populate it using a script. The best way (IMO) is to use the calculation event of a (hidden) text field. Say the first group is called Answer1 and the second is Key1. You could use the following code for them:

this.getField("Key1").value = this.getField("Answer1").value;

 

Participant
March 29, 2024

How would that work for radio buttons then with a text field? What I mean to say is if it's a text field, how would it then toggle the radio button? Or am I missing a step in my head?

try67
Community Expert
Community Expert
March 29, 2024

The text field is used to populate the radio-buttons, as the latter don't have a Calculate event of their own. The text field itself can be hidden. And you can use a single text field for the code to populate multiple fields, by duplicating the line I provided, just adjusting the field names each time.