Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Latest commit

 

History

History
31 lines (22 loc) · 800 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 800 Bytes

JQuery Optional Number Step

Dynamic HTML5 number step.

HTML5 forms has own validation for step rule.

This plugin add step attribute to field temporarily while changes are made.

You can specify any numeric value on keyboard.

HTML5 step validation will not be applied.

Demo

https://codepen.io/ArtZ91/pen/omePje

How to use

  1. include jquery.number-step.js script to your web page. jQuery required!
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="jquery.number-step.js"></script>
  1. Add optionalNumberStep function to your input[type="number"] fields.
$('[name="width"]').optionalNumberStep(100);
  1. To deactivate dynamic step use 'unset' value.
$('[name="width"]').optionalNumberStep('unset');