Radio buttons

hi
i m new to rails and i m facinga problem with radio buttons. i need to
create a portal with multiple choice question. i m using html here.
once i submit the answer the page is getting refreshed and the
selected radio button is also refreshed. and is show a page with no
radio button selected.

<form>
<br>
<input type="radio" name="radios1"
onclick="this.parentNode.submit();" value="<%=@abc.a%>"><%=@abc.a
%><br>
<input type="radio" name="radios1"
onclick="this.parentNode.submit();" value="<%=@abc.b%>"><%=@abc.b%>
<br>
<input type="radio" name="radios1"
onclick="this.parentNode.submit();" value="<%=@abc.c%>"><%=@abc.c%>
<br>
<input type="radio" name="radios1" onclick="this.parentNode.submit();"
value="<%=@abc.d%>"><%=@abc.d%> <br>
<br>
<br>
<br>
<input type="submit">
</form>

please do give me a solution for this

hi
i m new to rails and i m facinga problem with radio buttons. i need to
create a portal with multiple choice question. i m using html here.
once i submit the answer the page is getting refreshed and the
selected radio button is also refreshed. and is show a page with no
radio button selected.

The page is going through a submit/refresh cycle, and that does re-set the form elements to their default.

<form>
<br>
<input type="radio" name="radios1"
onclick="this.parentNode.submit();" value="<%=@abc.a%>"><%=@abc.a
%><br>
<input type="radio" name="radios1"
onclick="this.parentNode.submit();" value="<%=@abc.b%>"><%=@abc.b%>
<br>
<input type="radio" name="radios1"
onclick="this.parentNode.submit();" value="<%=@abc.c%>"><%=@abc.c%>
<br>
<input type="radio" name="radios1" onclick="this.parentNode.submit();"
value="<%=@abc.d%>"><%=@abc.d%> <br>
<br>
<br>
<br>
<input type="submit">
</form>

please do give me a solution for this

You have two options -- either submit the form through Ajax, so the page doesn't get refreshed, or store the result of the form submission in the session or the database and use it to default the form to the chosen value when the visitor reloads the form.

Walter