I have a complex form (CActiveForm) consists of 4 questions with several checkbox lists and radio buttons. When user visits the page, only the first question is visible. The each next question will appear only if at least one checkbox was checked in previous question (jquery).
Now if I submit form, but its validation fails, error messages display above the form, all checkboxes became unchecked and all question except the first one became invisible.
Is there a simple way to save checked checkboxes and display all questions if form's validation fails?
Maybe yii1 have some standard methods for this? Or the only solution is using of Ajax validation?
You could use some local storage, either via a SESSION variable in something like PHP or indexDB in Javascript to store the form values each time on submit, before validation. Then if validation fails, refill in the form with the saved form data.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.