Jayy
Jayy

Reputation: 2436

List all the invalid controls in Orbeon forms

I have 30 fields in my form. At the bottom of the form I have a button where if I click on it, it should display all the fields which are invalid. Invalid includes not filling the mandatory fields also.

Using xforms:trigger I can create a button and using DOMActivate even I can write xforms:action. But what should I write inside the xforms:action to list all invalid fields.

Upvotes: 1

Views: 229

Answers (1)

avernet
avernet

Reputation: 31743

You can implement your own error summary by listening to events like xforms-valid and xforms-invalid, keeping track of which controls are valid and invalid. But this is not a trivial task, especially if you want to handle repeats, and even nested repeats. Fortunately, this work has been done already for you, and the code has been put in a reusable component: <fr:error-summary>.

If you are using Form Runner, the error summary is setup for you by default. Otherwise, see this documentation on how to use the error summary component.

Upvotes: 2

Related Questions