saseow
Posts: 744
|
| Posted: 02/20/2009, 3:48 AM |
|
In the On Validate event of an editable grid I have the following code:
if (strtotime($Container->end_time->GetValue()) <= strtotime($Container->start_time->GetValue()))
{
$Container->Errors->addError("The finish time is the same or smaller than the start time!");
}
The error is always shown.The format of both time fields is h:nn AM/PM
Any ideas?
|
 |
 |
laneoc
Posts: 154
|
| Posted: 02/22/2009, 12:20 PM |
|
I use a client side "validation rule" setting on the component.
Where "btime" is the component for the beginning time and etime is the component for the end time:
$this->btime->GetValue()<=$this->etime->GetValue()
Lane
_________________
Lane |
 |
 |
saseow
Posts: 744
|
| Posted: 02/22/2009, 2:11 PM |
|
Thanks for the reply. I would have thought that it was dead easy but no!
I have :
$work_detail->start_time->GetValue()<=$work_detail->end_time->GetValue()
in the Validation Rule of the end_time Textbox and keep getting the Call to a member function GetValue() on a non-object in error. The form name (work_detail) and the start and end time fields are all named correctly.
I just do not know what the hassle is.
|
 |
 |
saseow
Posts: 744
|
| Posted: 02/22/2009, 2:19 PM |
|
OK, I still do not know what the problem was but have redone it and it works:
if ($work_detail->start_time->GetValue()>=$work_detail->end_time->GetValue())
{
$work_detail->Errors->addError("The finish time is the same or smaller than the start time!");
}
|
 |
 |