-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Forms - Builder, Forms - Field Types
-
None
-
Severity 3 - Minor
Issue Summary
If a field within a JSM form has a minimum length added but is not marked as required, the behavior of this validation is inconsistent and misleading. If the value is empty, the initial submission of the form will succeed. However if the form is left open for edits, the subsequent submission of the form will fail and it will note that the field is required.
Steps to Reproduce
- Add a Form to a Request Type with a field that has a minimum and maximum value set, but it is not marked as required. The form also should be left open for edits.
- On the portal submit the form during initial issue creation leaving that field with the requirements blank.
- On the portal (or in Agent view) edit the form but not that field with the length requirements. That was left blank was it was during the initial submission and should still be left blank.
- Submit the form again, notice that now you are not able to submit the for there is an error with that field indicating that field is required.
Expected Results
The inconsistency is the issue here, however there should be a bigger conversation about how this functionality should work. There are two potential options:
- Empty values should be exempt from the minimum validations unless they are also marked as required thereby separating the two types of validations.
- If minimum values are enforced on empty values (which could make sense since empty is less than the required minimum), then the required checkbox should be automatically checked and this should be documented that this is the behavior.
If option 1 is chosen above, the error message the that is presented if this field fails the length validation (for non-empty fields) should note the length requirements, not just note that the field is required. If option 2 is selected the error message can stay the same since the field will be automatically required if there is a length restriction.
Actual Results
The form will not submit second time but will submit the first time (which is inconsistent.
The error message is also misleading, while it could be understood that an empty value is less than the required minimum, the field is not marked as required, so the message should be updated to note that it requires a minimum number of characters. However, it should also be reviewed to determine if empty values should be exempt from this validation unless the field is marked as required.
Workaround
The only known workaround at this time would be to remove the minimum length requirement (which will allow empty values to pass this validation).
Alternatively users could just be required to enter a value which satisfies the length requirements. This will allow the form to submit as well.