Ton
Posts: 12
|
| Posted: 12/03/2007, 8:47 AM |
|
Hello,
I have build a grid. In that grid there are 2 date fields besides some other stuff . A startdate and an enddate. I know want to make sure that the end date is always later than the start date so I have to check users input. How can I do that? Can someone give me a helping hand?
Thanks for your feedback!
Greetings from Holland, Ton
_________________
_____________________________________
Origin: NL, CSS4 / PHP / MySQL |
 |
 |
aondecker
Posts: 58
|
| Posted: 12/04/2007, 8:01 AM |
|
Quote Ton:
Hello,
I have build a grid. In that grid there are 2 date fields besides some other stuff . A startdate and an enddate. I know want to make sure that the end date is always later than the start date so I have to check users input. How can I do that? Can someone give me a helping hand?
Thanks for your feedback!
Greetings from Holland, Ton
On your form, make custom code under the On-Validate event. In there compare the two dates and if the 1st is greater than the 2nd then return an error. (assuming both fields are date fields)
if ($FORMNAME->STARTDATE->GetValue() > $FORMNAME->ENDDATE->GetValue())
$FORMNAME->AddErrors("End Date is less than Start Date.")
|
 |
 |
Ton
Posts: 12
|
| Posted: 12/04/2007, 8:30 AM |
|
Thnx mate. Ik works!
rgds
Ton
_________________
_____________________________________
Origin: NL, CSS4 / PHP / MySQL |
 |
 |
|