Mevrael / bunny

BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
https://bunnyjs.com
MIT License
486 stars 39 forks source link

Success class #18

Closed zslabs closed 7 years ago

zslabs commented 7 years ago

Hi all, I saw there was a errorClass option, but am not seeing anything that would allow a "success" class to be added to input groups - is that possible?

Mevrael commented 7 years ago

Hi @zslabs

Thank you for your interest in the BunnyJS and submitting your issue.

Please, in the future, always provide all the detailed information about your issue - which component exactly are you speaking about, that might be also represented in the title of the issue.

I suppose you are talking about the src/Validation.

Since success state to input is added in very rare cases and I can't remember any of them, there is currently no success state in Bunny Validation, thus, there is no option to add a success class.

Could you, please provide, a use-case, how exactly and when exactly you would like to add a success state to your input? I suppose during the Validation.validateSection() or init() when inputs are checked, if input passed a validation you would like to add a different class to an input group, am I right?

zslabs commented 7 years ago

Hey @Mevrael, Appreciate the reply. Here's a screen shot of the various states of form inputs that I'd be looking for:

screen shot 2017-02-05 at 2 44 37 pm

I use the following classes on what Bunny refers to as the the form container,

Mevrael commented 7 years ago

0.14.9

added ValidationConfig.classInputGroupSuccess which defaults to BS4 has-success.

To activate this feature add showvalid attribute to <form>

zslabs commented 7 years ago

Awesome, thanks!