Good day,
Part of a form I created consists of two groups of radio buttons that display specific text depending on which button is selected.
If a user clicks the submit button, but hasn't incorectly inputed something wrong (or has missed a field), the page reloads and displays an error at the top. Unfortunately, the radio button are resetted to no selection, so the user has to choose the options again in order to display the relevant text that needs to be amended.
How can I make it so the radio buttons do not reset once the page reloads (i.e. there selections will be saved)?
Note: I cannot stop the page from reloading after a user clicks submit; it's just the way the CMS is set up.
I've tried some scripts and searched Google, but I cannot seem to get anything to work due to the restrictions of the ancient CMS I'm working with.
<p id="submit">Please select one of the following:<strong class="required" style="color:red">(required)</strong></p><div>
// Here is one of the radio button groups that need to be saved. You'll notice that they are calling a script to display specific text when selected
<input type="radio" name="type" id="selection1" onclick="myOwnBehalf()" required> I am submitting this question on my on own behalf.<br/>
<input type="radio" name="type" id="selection2" onclick="onBehalfSomeone()" required> I am making this question on behalf of someone else.<br/>
<input type="radio" name="type" id="selection3" onclick="anon()" required> I would like to be anonymous.<br/>
....
The radio button selections are reset to blank once the page reloads because the users filled it out incorrectly.