Welcome Guest, Not a member yet? Register   Sign In
Consult: How to compare time field using form validation
#11

[eluser]terrycyleung[/eluser]
Thanks all, it works now after I modifed the function with your suggestion, thank you so much.


function time_check($start_time ,$end_time)
{
$start_time = $this->input->post('start_time');
$end_time = $this->input->post('end_time');

// Does the start time occur after the end time?
if (strtotime($start_time) >= strtotime($end_time))
{
echo strtotime($start_time);
$this->form_validation->set_message('time_check', '%s cannot occur after End Time');
return FALSE;
}else{
// All is well.
return TRUE;
}
} // End time_check




Theme © iAndrew 2016 - Forum software by © MyBB