Hi,
I have a big dinamycally form. I have test with questions and answers data. My $_POST array look like:
array
'test' =>
array
'name' => string 'Тест просто тест2' (length=31)
'description' => string 'Проверка хрени какой-то )' (length=45)
'way_of_result' => string 'numeric' (length=7)
'state' => string 'cancelled' (length=9)
'question' =>
array
'que_1' =>
array
'text' => string 'Вопрос 1' (length=14)
'type' => string 'checkbox' (length=8)
'answer' =>
array
...
'action' => string 'add' (length=3)
'que_2' =>
array
'text' => string 'Вопрос 2' (length=14)
'type' => string 'radio' (length=5)
'answer' =>
array
...
'action' => string 'add' (length=3)
'que_3' =>
array
'text' => string 'Вопрос3' (length=13)
'type' => string 'textbox' (length=7)
'action' => string 'add' (length=3)
, where answer array is:
array
'ans_1' =>
array
'weight' => string '101' (length=3)
'text' => string 'отв1' (length=7)
'action' => string 'add' (length=3)
'ans_2' =>
array
'weight' => string '102' (length=3)
'text' => string 'отв3' (length=7)
'action' => string 'add' (length=3)
'ans_3' =>
array
'weight' => string '103' (length=3)
'text' => string 'отв5' (length=7)
'action' => string 'add' (length=3)
REQUEST:
1) I want to validate my data in arrays. See http://codeigniter.com/forums/viewthread/117694/
$this->form_validation->set_rules('question[que_(:num)][text]', 'lang:question_name', 'required|max_length[100]');
$this->form_validation->set_rules('question[(:num)][text]', 'lang:question_name', 'required|max_length[100]');
$this->form_validation->set_rules('question[(:num)][answer][ans_(:num)][weight]', 'lang:answer_weight', 'required|numeric');
$this->form_validation->set_rules('question[(:num)][answer][(:num)][weight]', 'lang:answer_weight', 'required|numeric');
2) CI wrong parse field names like ‘test[image]’ in form_validation matches method, in do_upload method and other…
$this->form_validation->set_rules('user[password_conf]', 'lang:user_password_conf', 'required|matches[user[password]]');
$this->upload->do_upload('test[image]')
returns ‘You did not select a file to upload.’
