close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

date will not validate

Thread began 9/30/2015 3:49 pm by atstech | Last modified 10/01/2015 9:57 am by Ray Borduin | 857 views | 3 replies |

atstech

date will not validate

Using CS6 and Data Bridge 1.2.3
I'm having trouble validating a date field. WA Server Validations are set as allow mm-dd-yyyy format. The validation passes as long as the "day" portion of the date is 01-12, otherwise the validation fails. For example, 09-12-1996 validates but 09-13-1996 fails. 07-07-1996 validates but 07-15-1996 fails. This issue appears on both the insert and update pages. What am I missing?

Sign in to reply to this post

Ray BorduinWebAssist

Dates separated with dashes instead of slashes are considered European date format by php. That means 09-01-1996 would be interpreted as January 9th. This explains why it is failing, but really our server code should account for it and allow it to pass.

I think the easiest solution is to use slash formatted dates like: 09/13/1996 instead of 09-13-1996 because that will solve the problem without needing to do any more. I can look into the issue with dashed dates in the meantime and try to get a fix out so that it will work properly in the future.

Sign in to reply to this post
Did this help? Tips are appreciated...

atstech

Thank you for your reply. If my only option is to switch to slashes / then I guess I will have to. This will cause inconsistencies since I have over 5000 entries in MySQL already using dashes and it will break code used to calculate a persons age. I initially chose dashes because that is how MySQL formats DATESTAMP.

Sign in to reply to this post

Ray BorduinWebAssist

Another solution would be to only replace it in the validation...

so on the insert page line 25 you can change it to:

$WAFV_Errors .= WAValidateDT(((isset($_POST["dob"]))?str_replace("-","/",$_POST["dob"]):"") . "",true,"\b(1[0-2]|0[1-9])/([12]\d|3[0-1]|0[1-9])/\d{4}\b","","",false,".*","","",true,13);

Sign in to reply to this post
Did this help? Tips are appreciated...

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