Compare start and end date?
Is there an easy way to compare a start date to the end date using the server validation behaviour or spry?
Is there an easy way to compare a start date to the end date using the server validation behaviour or spry?
I came across this DW extension a while back and downloaded it, but have yet to use it. Not sure if it will accomplish what you're looking for, but I wanted to throw it your way.
Compare%20Date%20Fields
I'm pretty sure that it is possible to do this with Form Validations within DataBridge... just haven't figured it out yet. :)
you can use dynamic data in the date / time validation for the minimum and maximum dates.
The example is will use uses form elements named startDate and endDate
Add Date Date Validation for the startDate form field, and use the following code for the Maximum date setting:
<?php echo((isset($_POST["endDate"]))?$_POST["endDate"]:"") ?>
Use Date Validation again for the endDate form element, this time set the Minimum Date to use the start date form element:
<?php echo((isset($_POST["startDate"]))?$_POST["startDate"]:"") ?>
Thank you Jason,
I thought this could be done with WADA.
Now, I've noticed an interesting thing, as the dates already have validation (that they are a date and that one of them is required) I thought that I would simply add the min and max checks to the existing validations.
It seems that when I open the validations server behaviour and edit the startDate or endDate that the min/max options are greyed out and unavailable.
If I uncheck date, then time automagically selects itself and I can then reselect date and unselect time and then the min/max boxes are available.
This seems like it might be a small bug in the interface?
A further issue has also occured.
With the validation in place for the end date:
I have deleted these pages, regenarated them and ended up with the same issue, the record id is not being passed to the query after the date failure is fixed.
Any help would be appreciated.
Further investigation reveals this code for the hidden form element for the record ID:
<input type="hidden" name="WADAUpdateRecordID" id="WADAUpdateRecordID" value="<?php echo((isset($_GET["invalid"])?ValidatedField("testupdate","val"):$_GET["SANITIZETHEID"])); ?>" />
Not sure where: ValidatedField("testupdate","val") comes from - it doesn't seem valid.
"This seems like it might be a small bug in the interface?",
Yes, it is a bug, I have logged it to be corrected in the next update.
ValidatedField("testupdate","val") is the validated entries value. it should return the initial value when validation fails
please send a copy of the page so I can examine the code.
Please open a ticket so that I can send you my page.
I have gotten around the issue for now by using the get value.
I have created a support ticket so we can look into this issue further.
To view and edit your support ticket, please log into your support history:
supporthistory.php
If anyone else is experiencing this same issue, please append to this thread.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.