काम नहीं कर रहा प्रोफ़ाइल डेटा की एक सरणी है मैं मान्य करने के लिए की जरूरत है:CodeIgniter: मान्य प्रपत्र सरणी
$user_group_profiles = $this->input->post('user_group_profiles', TRUE);
foreach ($user_group_profiles as $key => $user_group_profile)
{
$this->form_validation->set_rules("user_group_profiles[$key][profile_name]", 'Profile Name', 'trim|required');
$this->form_validation->set_rules("user_group_profiles[$key][birthdate]", 'Birthdate', 'trim|required');
// TODO: heigth/weight not required, but the validation somehow makes it required
$this->form_validation->set_rules("user_group_profiles[$key][height]", 'Height', 'trim|greater_than[0]');
$this->form_validation->set_rules("user_group_profiles[$key][weight]", 'Weight', 'trim|greater_than[0]');
}
ऊंचाई और वजन विकल्प हैं, लेकिन जब कोई मूल्य नहीं उन क्षेत्रों के लिए निर्धारित है, सीआई सत्यापन शिकायत।
array
'ugp_b33333338' =>
array
'profile_name' => string '' (length=0)
'birthdate' => string '' (length=0)
'height' => string '' (length=0)
'weight' => string '' (length=0)
कोई भी विचार क्या गलत हो सकता है: एक var_dump($user_group_profiles);
यह दिखाता है?
संपादित करें 1:
मैं सीआई के Form_validation पुस्तकालय में चला गया और $_field_data
और जनता के सदस्य बनाया। जब मैंने इसे बाद var_export, मैं यह मिल गया:
'user_group_profiles[ugp_833333338][height]' =>
array
'field' => string 'user_group_profiles[ugp_833333338][height]' (length=42)
'label' => string 'Height' (length=6)
'rules' => string 'greater_than[1]' (length=15)
'is_array' => boolean true
'keys' =>
array
0 => string 'user_group_profiles' (length=19)
1 => string 'ugp_833333338' (length=13)
2 => string 'height' (length=6)
'postdata' => string '' (length=0)
'error' => string 'The Height field must contain a number greater than 1.' (length=54)
'profile_name' और' birthdate' भी खाली हैं? – Hindol
हां, मैंने संरचना को दिखाने के लिए किसी भी इनपुट के बिना फॉर्म सबमिट किया है। – StackOverflowNewbie
क्या मैं आपके एचटीएमएल मार्कअप को देख सकता हूं? [पास्टबिन] (http://pastebin.com/) – Rocco