Welcome Guest, Not a member yet? Register   Sign In
Dynamic form building with validation
#1

[eluser]Unknown[/eluser]
I'm just about to start a project so I've decided to use CI, but I have a few questions regarding dynamic forms & validation.

I have a requirement for an admin page within which users can be added dynamically. Adding users will comprise of a series of fields - some of which will require validation. This needs to be done in such a way so that a user can click an add button and the user fields get expanded out & displayed, user inputs, validation fires (client (jQuery) & server-side) & ajax call to save data. A list of users gets updated with the recently added shown at the top.

What's the best way of showing & validating dynamic form content within CI?

Thanks
#2

[eluser]kanjimaster[/eluser]
How you display the dynamic form is a question of preference. Some people would build it in javascript, some would include it in the CI view when the page is built but hide it, others would give it its own view and ajax it in when needed. All are valid approaches.

Server side validation of the form is not affected by it having been loaded dynamically, so the normal CI validation approach described in the CI user guide is the only way to go ... though I'd recommend adding some in-browser validation too - though that's beyond the scope of CI.




Theme © iAndrew 2016 - Forum software by © MyBB