Welcome Guest, Not a member yet? Register   Sign In
Callback Validation and Multiple Parameters
#5

[eluser]Namsu[/eluser]
The implode and explode isn't working for me! I end up with only having one element in the array at position 0. Also used print_r to tell me. Any ideas?

$dates = $this->input->post('datepickers');
$datef = $this->input->post('datepickere');
$darr = array (0 => $dates, 1 => $datef);
$imp = implode(",", $darr);

$this->form_validation->set_rules('datepickers', 'Date Range', 'callback__dateRange[' . $imp . ']');

function _dateRange($date) {

$dated = explode(",", $date);
$date1 = strtotime($dated[0]);
$date2 = strtotime($dated[1]);
print_r($dated);

if ($date1 >= $date2) {

$this->form_validation->set_message('_dateRange', 'Invalid Date Range.' . $dated[0] . $dated[1]);
return FALSE;
} else {

return TRUE;
}
}


Messages In This Thread
Callback Validation and Multiple Parameters - by El Forum - 08-30-2010, 02:07 PM
Callback Validation and Multiple Parameters - by El Forum - 08-30-2010, 03:15 PM
Callback Validation and Multiple Parameters - by El Forum - 08-30-2010, 03:26 PM
Callback Validation and Multiple Parameters - by El Forum - 08-30-2010, 04:41 PM
Callback Validation and Multiple Parameters - by El Forum - 08-31-2010, 09:43 AM
Callback Validation and Multiple Parameters - by El Forum - 08-31-2010, 02:03 PM
Callback Validation and Multiple Parameters - by El Forum - 09-02-2010, 06:34 PM
Callback Validation and Multiple Parameters - by El Forum - 09-07-2010, 09:27 PM
Callback Validation and Multiple Parameters - by El Forum - 09-08-2010, 03:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB