Validation on fields on page before submitting data

I have a collection form with fields that has a submit button on it which works fine, but how do I force it to return to the previous page or display an error if the fields are left blank? There is a cancel button with an event of page navigation that returns to previous page, but I would like the submit button to validate and if the fields are blank to automatically return if possible.

Is there a javascript that can be used to accomplish this

Hi @pprecision,

We have a concept of Validations rules in Collection settings, which can be applied to any form, so that you can decide which fields needs to be filled as mandatory while filling the form.

You can create validation rules from there, and then you can bind those rules to the collection form.

Alternatively, you can use custom Javascript code if you want.

Thanks.

Thanks.