Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: date input

$
0
0
Re: date input
Web Connection
Re: date input
May. 15, 2013
08:00 pm
3SA16W5X1Show this entire thread in new window
Gratar Image based on email address
From:Chris ODonnell
To:Rick Strahl
Rick - on the subject of date picker controls, i just wanted to point out that when searching the WWC forum based on dates, the user (this user anyway) does not see the full year on the from/until dates. Its 201 instead of 2013. It would be handy to see the full year in order to TYPE IN the year instead of firing the calendar date picker. Faster. However, this is not the case on the left side of the msg board where the "from date" and "to date" date selections are presented.


FoxPro format commands don't work in Web controls, so no that won't work. Using the format masks will format the date for display, but won't restrict the input in any way. The user can input whatever they want.

The way to handle this typically is to do your server side bindings and validation - if an invalid date is input the date binding will fail and give you a binding error. If you follow the typical examples in the Web Connection docs using business objects an invalid date will never make it through a save due to the validations.

Another option - and a good on IMHO - is to use the DatePicker control which will encourage users to pop up the calendar to pick dates. The calendar will ensure the date's in the right format.

Finally you can also write some JavaScript validation that can check for date formatting. This is easy if you're only dealing with US dates (ie. numbers and / input chars) and validating the final date to be valid, but it's a one time manual process. If you search you can probably find one.

+++ Rick ---


Years of Foxpro has dulled my mind. On a form a date variable automatically does all the work of formatting and requires the entry of a valid date.

Can I do this in Webconnection? I tried binding to a data variable and using either @yl or @d as a control source format but on the resulting web page I can type in anything.

Potter




Viewing all articles
Browse latest Browse all 10393

Trending Articles