Date Validation not working in Enketo

The form instructs that the date must be between March 1, 2023, and the current calendar date. However, when I enter April 17, 2024 or any other date thats falls within the specified range—the form returns an error, stating that the field is required and that the date must be between March 1, 2023, and today’s date. This only occurs when I use Enketo and not the mobile app

I would appreciate assistance in resolving this issue, as it is preventing me from submitting the form.

image

Hi @Akorede and welcome to the community!

Can you also share the constraints you use so we can take a look at them?

1 Like

. >= date(‘2023-03-01’) and . <= today()

Hi @Akorede,

Can you try the following:

. >= date("2023-03-01") and . <= today()

1 Like

Is there another way to fix this issue without changing the constraint and redeploying? The form is live, and real-time data is being collected. The constraint works perfectly on the mobile app, but the issue occurs when I try to edit a submitted form using enketo.

Well, if everyone is filling the form in mobile app, and you only need to edit some of them, there is a bulk edit function you can use which surpasses Validation logic and calculations within your form.

But keep in mind that this is a dirty and risky hack, which can confuse your data even more, if it’s not used properly.

https://support.kobotoolbox.org/howto_edit_multiple_submissions.html

1 Like

@hakan_cetinkaya, :bowing_man: :heart:

1 Like