Array Field Validation with Callback Function |
[eluser]foxybagga[/eluser]
Hello folks, I am really enjoying working on CI - its just superb! I just wanted a tip if someone could help with the Form Validation that I need to do. My form fields looks like below Code: <label for="shift_from[1]">Shift Start</label> The view code is as below. Code: <div class="<?php if (form_error('shift_from[' . $counter . ']') != "") echo "error"; ?>"> I am having multiple shifts selectors with Shift Start and Shift End select boxes which are populating and working properly. I am settings the validation rules as below Code: $fromArray = $this->input->post('shift_from'); Code: public function check_shifts(){ The problem is the when any one or two of the shift timings are same - every select box shows the error (including the ones that are correct too) and not those individual ones. Here is a preview of how the submitted form looks like - http://i.imgur.com/FUzeY.png If you can see - the first shift has different timings - still its showing an error. The values are different and are simply strtotime. Any clues how to do it? |
Messages In This Thread |
Array Field Validation with Callback Function - by El Forum - 10-09-2012, 09:00 AM
Array Field Validation with Callback Function - by El Forum - 10-09-2012, 10:51 PM
Array Field Validation with Callback Function - by El Forum - 10-09-2012, 11:12 PM
Array Field Validation with Callback Function - by El Forum - 10-09-2012, 11:32 PM
Array Field Validation with Callback Function - by El Forum - 10-10-2012, 01:41 AM
Array Field Validation with Callback Function - by El Forum - 10-11-2012, 12:16 AM
|