Welcome Guest, Not a member yet? Register   Sign In
Question about form validation
#1

[eluser]bonjurkes[/eluser]
Hello,

I used a script that is premade with checkboxes for my own project. But at the source of the script that i found it required for form fields to get validated before submitted.

So here comes the problem, i have like 61 checkboxes on my form, and writing like this :

Code:
$this->form_validation->set_rules('a60', 'a60', 'trim|max_length[255]');

will take so much time and wont look so nice in the code. My all formfield's id stars with "a", so is there a way to use something like "$a. $i" for setting rules for every field ? How can i do that ? Otherwise i have to type like a61, a60, a59 etc.


Messages In This Thread
Question about form validation - by El Forum - 06-06-2011, 08:06 AM
Question about form validation - by El Forum - 06-06-2011, 08:25 AM
Question about form validation - by El Forum - 06-06-2011, 11:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB