CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 compare two dates before submitting form

Print topic Send  topic

Author Message
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
View profile  Send private message
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.")
View profile  Send private message
Ton

Posts: 12
Posted: 12/04/2007, 8:30 AM

Thnx mate. Ik works!
rgds
Ton
_________________
_____________________________________
Origin: NL, CSS4 / PHP / MySQL
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.