Welcome Guest, Not a member yet? Register   Sign In
$this->form_validation->set_rules("array[$key]", '', "");
#1

[eluser]megabyte[/eluser]
So I have two forms, one adds and one edits. Data is stored in the database.

The form has an array of text fields.

On the edit form you'll have the fields named as such

Code:
field[]
field[]
field[]

and I use

$this->form_validation->set_rules("field[]", '', "callback_function_here");

but when you edit, those fields have keys so that they match a field in the database table.

So as far as I can tell, I can't do this anymore when I edit, because I am populating the form as such

Code:
field[primary key]
field[primary key]
field[primary key]

$this->form_validation->set_rules("field[]", '', "callback_function_here");

Any suggestions on a simple solution that works every time? Keeping in mind I need to keep using an array of text fields.

thanks.
#2

[eluser]megabyte[/eluser]
no one has an answer?




Theme © iAndrew 2016 - Forum software by © MyBB