Welcome Guest, Not a member yet? Register   Sign In
Pagination with Form Fields
#1

Hi,

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.

Thanks
Khasim
Reply
#2

(This post was last modified: 06-24-2015, 08:55 AM by Dracula.)

You can use sessions
Romanian CodeIgniter Team :: Translations :: Comunity :: Developers
http://www.codeigniter.com.ro
Reply
#3

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




Theme © iAndrew 2016 - Forum software by © MyBB