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.


<%[email protected] %>
<%[email protected]%>
<%[email protected]%>
<%[email protected]%>



please do give me a solution for this

On Dec 13, 2011, at 1:11 AM, Reva wrote:

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.

onclick=“this.parentNode.submit();” value="<%[email protected]%>"><%[email protected]%>


<%[email protected]%>







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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs