About validating Date in context of Nepal


In context of nepal, there is no system of AD here we have BS system. I just am able to convert BS to AD. I just want user to enter the date of birth as it is in same format as AD. But I want the user to give the instruction as we have yyyy-mm-dd as today is 2077-10-27 and if the user input the date manually as 10-27-2077 it should give an error please input as yyyy-mm-dd
DOB.xlsx (5.9 KB)

Hello,
As your example uses date type, only valid dates can be selected/entered in date widget KoBo/ODK Collect and in Enketo. So, what exactly is your validation question?

Otherwise you could use:

  • a constraint (with constraint_message) on the first field, using regex(…). instead of your 2nd field
  • the hint feature in KoBo/Collect, for better (layout) separation of the hint from the question label.

See
https://support.kobotoolbox.org/validation_criteria.html?highlight=constraint
https://support.kobotoolbox.org/restrict_responses.html?highlight=regex
https://xlsform.org/en/#regular-hints
https://support.kobotoolbox.org/question_options.html?highlight=hint#guidance-hint-optional

2 Likes