Hello! I need help :)
I have a doubt that I do not know how to do it.
I want to validate the hours field and the minutes field in this way:
• From April 1 to September 30, effective hours will be 7.
• From October 1 to March 31, the effective hours will be 7 and the minutes will be 33.
in my code:
a!sideBySideItem( item: a!integerField( labelPosition: "ABOVE", value: ri!Regis.hours, saveInto: {ri!Regis.hours}, align: "LEFT" ), width: "MINIMIZE" ), a!sideBySideItem( item: a!textField( labelPosition: "ABOVE", value: " Hours ", readOnly: true ), width: "MINIMIZE" ), a!sideBySideItem( item: a!integerField( labelPosition: "ABOVE", value: ri!Regis.minute, saveInto: {ri!Regis.minute} ), width: "MINIMIZE" ), a!sideBySideItem( item: a!textField( labelPosition: "ABOVE", value: " Minute", readOnly: true ) )
thanks so much!!
Discussion posts and replies are publicly visible
Hi Alastr, as this is not clear from the query whether you want the validation at the text field level (i.e. when the value gets populated) OR while submitting the form, you can validate this in different ways. A simple way is as follows (just for reference):
Use the validations option available for the text field component and use if conditions to validate the hours and minutes within the range. You can have the date range in a constant OR local variables. For example - validations: if(and(day(now())>=1,month(now())>=4,ri!Regis.hours>7), "Can't be more than 7", {})
The effective hours and minutes will be an automatically modified and initialized field with values depending on the creation date of the input task: • From April 1 to September 30, effective hours will be 7. • From October 1 to March 31, the effective hours will be 7 and the minutes will be 33.thanks
hours and minutes are auto populated or user will enter it?
the hours and minutes fields must be initialized when loading the page with 7 hours From April 1 to September 30 7 hours and 33 minutes From October 1 to March 31
from where you will get the date ,from start time of task ?