Form validation and array-based form names |
[eluser]Unknown[/eluser]
Hi folks, This is a question about form validation. I am dynamically generating a list of existing users from the database so as to enable the admin to change their personal details. I'm doing so with array-based form names so the code would look like this: Code: <label for="username2">Edit Cathy Brown</label> The number value, of course, corresponds to the user id in the database table When I am submitting for form submission I could just check the values like so: Code: if(empty(implode($_POST['usernameEdit'])) { The above uses the implode function to covert the array to a string but what do I need to do so as the set_rules method can handle the input: Code: $this->form_validation->set_rules('usernameEdit', 'username','trim|required|max_length[30]'); It is giving me an error message that it is an array not a string |
Welcome Guest, Not a member yet? Register Sign In |