Welcome Guest, Not a member yet? Register   Sign In
validation problem with multi-page form: radio buttons seem to inherit previous selection state
#1

[eluser]moonbeetle[/eluser]
Hi I want to build a multi-page survey with CI. Let's say I want to show 32 questions and offer them on 4 sequential pages each time showing 8 multiple-choice questions (2 answers to choose from per question by selecting a radio button) per page. At the and of the page a submit button is used to go to the next page until the end (page count) is reached.

Like this: page1 -> page2 ->page3 -> page4

Validation is crucial as I want the user to answer to each question.

I update the page count as well as the offset (for fetching the question from a database). I do this in case $this->validation->run() is TRUE. Then I load the view again, passing the updated values and next batch of questions. In case the validation returns FALSE, meaning one or more questions haven't been answered, I show the page again and use $this->validation->set_radio() to set the selected state for the questions that have been answered.

The problem:
the multiple-choice selection from a previous page gets passed to the next page. Why is this or how can I reset this without losing the benefit of usability?


Messages In This Thread
validation problem with multi-page form: radio buttons seem to inherit previous selection state - by El Forum - 07-18-2007, 02:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB