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.
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.
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.