Description
Default can only use fixed (literal) values, like 1 or ‘my text’. If you use something else, like a wrong format, a $-Reference or even calculation, the entry field will temporarily be treated as required. (even if explicitly set to false).
Problem is only with Preview/Enketo.
KoBoCollect works ok (Next not blocked)
Steps to Reproduce
See attached file
BugWrongDefault03.xlsx (12.0 KB)
- Set an invalid default, like “abc” for date field
- Move to field - No default is set, but, but date select widget opens
- Next, will only work if you entered a date!
Expected behavior
- Wrong default (and system in general) should not require data entry
- An error message on import or preview for non-valid defaults would be great.
- Support article that default works very restricted (No hint in XLSForm spec:
http://xlsform.org/en/#default - Add tag for “default”’ (or “default-value”) for community topics
Actual behavior
You are forced to enter a value, for the field by default or explicitly specified as required = false. See above screenshot and attached XLSForm.
Additional details
If you entered a field and moved on (Next) you can come BACK and delete your entry and move on now with Next WITHOUT being blocked as before. So it’s related to the DEFAULT situation!
Preview/Enketo on OCHA Server.
Furthermore, can someone tell, if the restriction for default-values is even on XLSForm level?
Kind regards