form_validation library and discrete functions ? |
[eluser]Monarobase[/eluser]
Hello, I'm sorry if there is a very simple answer to this one but I have read the docs, searched the wiki and searched the forum so I am positing my question here. I'm building a dynamic form which builds a form from database entries, I have made views per type of form input and am now working on the validation. My database contains collomns like : 'required' => 0 or 1 'min' => 0 (deactivated) or 1 to 99999 'max' => 0(deactivated) or 1 to 999999 I could easily build the rules lines and run something like this for each line : Code: if($db->required == 1) $rules .= ($rules == '') ? 'required' : '|required'; However the docs mention discrete functions, but I have not managed to get them to work ... This is what I have tried : Code: $this->form_validation->set_rules($v->name, $v->descr); It seems that it doesn't work like the database library though as the discrete functions are not taken into account. As you can see I have got my code working and it's more out of interest, but how are you supposed to use the "discrete" functions that the doc talks about here : http://codeigniter.in.th/user_guide/libr...ereference ? Thanks in advance |
Messages In This Thread |
form_validation library and discrete functions ? - by El Forum - 05-07-2010, 09:42 AM
form_validation library and discrete functions ? - by El Forum - 05-07-2010, 10:39 AM
form_validation library and discrete functions ? - by El Forum - 05-07-2010, 11:06 AM
form_validation library and discrete functions ? - by El Forum - 05-07-2010, 11:21 AM
form_validation library and discrete functions ? - by El Forum - 05-07-2010, 11:26 AM
|