• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pagination with Form Fields


I have a questionnaire and I am using pagination to display the questions with Yes / No radio options.

When user selects Yes I am enabling a TextArea to enter the Answer. But when I am navigating to different pages, the entered data is not staying.

Please suggest.


You can use sessions
Romanian CodeIgniter Team :: Translations :: Comunity :: Developers

This isn't really a CI question. It is due to the way html forms work.
If you fill in a form and you go to another page without submitting the form, nothing happens with the information that has been filled in.

So, before you move to another page, you have to submit the form and either store the data into the database, or into the session for later use.

Another approach is to put all questions in one big form, and use Javascript (or Jquery) to initially hide and later on show the fields that can be filled in. Jquery UI provides a "tabs" function that can be used to achieve this effect.
Say, your questionnaire has 10 steps, then your form is divided over 10 tabs (which are essentially divs inside a div that is marked as the tabs container). Initially, tab 1 is visible; the other tabs are hidden. When you move to the next question, tab 2 is shown, and the other tabs are hidden, etc. It has an option to hide tab headings, so the user doesn't see the tabs at all.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.