CodeIgniter Forums
Custom Form Fields! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Custom Form Fields! (/showthread.php?tid=23338)



Custom Form Fields! - El Forum - 10-07-2009

[eluser]Neeraj Kumar[/eluser]
Hi all!

I am currently working on a web application that will allow a user to create dynamic forms online and collect data using it.

So what I need to do is to create custom forms using codeIgniter. What I need to know is how to implement it as I also need form validation along with it.

Can anybody please help me out with it?

Regards


Custom Form Fields! - El Forum - 10-07-2009

[eluser]Colin Williams[/eluser]
Save form information to database.
Read form information from database and use to construct your form.

Anything specific hanging you up.


Custom Form Fields! - El Forum - 10-07-2009

[eluser]Neeraj Kumar[/eluser]
how to use form validation with it?


Custom Form Fields! - El Forum - 10-07-2009

[eluser]Colin Williams[/eluser]
You'll use the same form validation processes/functions, but you'll be using database supplied data and not hard-coding it

Code:
$form = $this->form_model->get_form($form_id);
$this->form_validation->set_rules($form['validation_rules']);

if ($this->form_validation->run())
{
   //...
}



Custom Form Fields! - El Forum - 10-07-2009

[eluser]Neeraj Kumar[/eluser]
ohh ok.. thanks