Multi step/page form in PHP & CodeIgniter

后端 未结 5 1398
青春惊慌失措
青春惊慌失措 2020-12-20 07:45

I\'m trying to build a multi step/page form in PHP and CodeIgniter and I was wondering if any of you could help me.

How can I have a multi step form in CI that updat

5条回答
  •  感动是毒
    2020-12-20 08:12

    If you want to avoid those messages which warn the user about resending posts, and you also want to have multiple proper pages rather than just different steps in javascript, you can put the answers in the URL as GET parameters.. so after the first form submission, you will get form2.php? in the URL.. you can add those answers as hidden variables in form2 and so on.
    It is not a very elegant solution though. I'd recommend you to use javascript: add a custom handler for form submission and submit form content via ajax, and then load the next form on ajax complete.
    Also, like the other person answered, on the server end, you will need a unique ID which fetches/updates the submission data in the database.

提交回复
热议问题