![]() Regular expressions for validation of various date and time formats. Other options I considered were having one of the sprocs return an error and display it, but we were using a custom portal to display reports and this was the simplest solution. Using JavaScript to validate date and time input fields. The following example allows minutes to be selected in increments of 15. With this technique your error parameter could check for multiple conditions and concatenate to its own value, but in my case I was only checking the one condition. While the min and max properties allow you to restrict date selection to a certain range, the monthValues, dayValues, yearValues, hourValues, and minuteValues properties allow you choose specific days and times that users can select. Visibility made easy as I just grouped all of my detail items in a rectangle and had to set the visibility of only the rectangle. You can combine the values to construct a new DateTime: DateTime dt Date.Add (Time. The error message textbox got its value based on the error parameter value. When the values are posted, the model binder successfully constructs DateTime types with the time portion set to midnight in the case of the date input's value, and the date portion set to today in the case of the time input's value. ![]() Then from there all I needed to do was set the initial visibility of my report items calculated based on the 3rd paramter having a length = 0 and my error message textbox on length > 0. If the beginning date parameter was before the threshhold then the error parameter got a value of the error message, otherwise an empty string. Setting state to boolean false will style the input as invalid, while setting it to boolean true will style it as valid. ![]() So I added a 3rd parameter (hidden, string) to the end of the parameter list that had a calculated value based on the beginning date parameter. Note the min and max date constraints are evaluated first, before date-disabled-fn. also not validate ifthe value of the field islessthan the min value. I know this is an old post, but I came across it because i had the same scenario so I will list my solution.Ä«asically I had the same thing, two date parameters and I wanted the report to display some kind of error if the beginning date was before some threshhold date. It frequently pops up the same calendar control as other date pickers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |