gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Show nr of invalid fields on Submit Button #618

Open 0xgeert opened 6 years ago

0xgeert commented 6 years ago

I'm pretty sure this is not supported but any helpers to custom make this are appreciated.

I'm looking for getting a badge to show on the submit-button indicating the number if invalid fields. So instead of solely disabling the submit button when 1 or more fields are invalid, I'd like to show something like:

screen shot 2018-03-09 at 17 55 30

Any pointers appreciated.

ambischof commented 6 years ago

I think you'd want to work with the view's valid and invalid or addMessage and removeMessages callback in this situation.

http://www.alpacajs.org/docs/api/validation.html