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.

Home Page:https://bunnyjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic checkbox required validation doesn't seem to work

StevenVerbiest opened this issue · comments

See JSFiddle:

https://jsfiddle.net/oc0veLLp/3/

The required error is always thrown, even when the checkbox is actually checked.

I am only including

  • babel-helpers.js
  • element.js
  • validation.js

Am I doing something wrong? Did I forget to include a js file? Or is this actually a bug?

You have value="" which makes your checkbox useless. Either remove value and let browser set it to default value which is on or set some value like 1 yourself.

Inputs with empty value are not validated as per spec. It is the same as having option in select with empty value.

That fixed the issue. Thanks!