close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Compare start and end date?

Thread began 7/19/2012 4:41 pm by Andrew Read | Last modified 7/20/2012 10:12 am by Jason Byrnes | 2795 views | 9 replies |

Andrew Read

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?

Sign in to reply to this post

MikeyT

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

Sign in to reply to this post

Andrew Read

I'm pretty sure that it is possible to do this with Form Validations within DataBridge... just haven't figured it out yet. :)

Sign in to reply to this post

Jason ByrnesWebAssist

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:
<?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:
<?php echo((isset($_POST["startDate"]))?$_POST["startDate"]:""?>
Sign in to reply to this post

Andrew Read

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?

Sign in to reply to this post

Andrew Read

A further issue has also occured.

With the validation in place for the end date:


  1. When the validation fails it returns me back to the page and spits out an error
  2. I correct the date to be after the start date
  3. Validation passes, however the record ID is not passed on, and the new information is not written into the database.


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.

Sign in to reply to this post

Andrew Read

Further investigation reveals this code for the hidden form element for the record ID:

php:
<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.

Sign in to reply to this post

Jason ByrnesWebAssist

"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.

Sign in to reply to this post

Andrew Read

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.

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...