Hi All,
I am working on a form that has validation a set of validation. I would like to users not to be able to submit the form if the condition is not met. I tried use display condition but this did not restrict submission.
I also tried to use the End of Form Navigation and created a condition using the path expression, it throw up an error when I tried to test it.
What and how can I get around this?
Christian
You can make a label question with a validation condition of false()
. The user will not be able to submit the form as long as this label is visible. Then you can use the label's display condition to write whatever set of validation requirements you'd like for the form.
For example, this label question will block the form from being submitted if the first and second questions have the same answer:
Thank you @Ethan_Soergel for the feedback. I followed this process before now and had done so following your feedback, it did not work.
I think there is a setting in commcare that needs to take the validation not to display the complete button. This is what am trying to ask for. Not sure if this clarifies my ask.
Thank you.
there are no specific controls for the "submit" button as far as I know!
but, it will only show up when ALL the elements in your form have passed their validation condition - this means that the formula in the validation condition attribute returns true() or 1
try just changing that false() into a 0 and the display condition to a 1 and see if the submit button still shows up
if it does, you may wanna contact support
HTH
Mazz
Thank you @Mazz . I have found a way to address it.
I first created a calculated hidden value that picks the error, then had added a question that references the hidden value, from where I added the validation rule. This worked perfectly for me.
Thank you all for your support.