Giter Site home page Giter Site logo

formprogressbar's Introduction

Form Progress Bar jQuery plugin

alt text

-Plugin adding progress bar on top to the page, which show how much fields you fill which are required.

-Modules works with validation libraries

Live Demo

You can preview this plugin on: https://wokay.me/projects/progressBar/

Quick Start

Import needed files

<script
  src="https://code.jquery.com/jquery-3.3.1.min.js"
  integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
  crossorigin="anonymous"></script>
  
  /* plugin files */
<link rel="stylesheet" href="formProgressBar.css">
<script src="formProgressBar.jquery.min.js"></script>

Init form

$("form").formProgressBar()

Options

readCount:true|false - If you turn on this option, form will be use classes to count correct fields. If you use Validator libraries, choice this option.

validClass:'string' - It's class used by validator to show that field is correct filled. If you enabled readCount progress will be based on valicClass. Default class is "valid"

invalidClass:'string' - This same rule, if field become invalid, progress bar change color. Class "error" is default.

percentCounting: true|false - If you want show in percent how much fields from required are filled correct you can enable this option

height: 'int' in pixel - Set height in pixel of progress bar

transitionTime: 'int' in milliseconds - If you want add animation to move progress bar and changing color, set transitionTime to some number in miliseconds

transitionType: ease|linear|ease-in|ease-out|ease-in-out if you set transitionTime you can set how transition should looks like

parentElement: 'string' default: body Element where progressbar html is located

Example initializate option

$("form").formProgressBar({
        readCount: false,
        validClass: 'valid',
        invalidClass: 'error',
        percentCounting: false,
        height: 20,
        transitionTime: 0,
        transitionType: 'ease' //
});

How color change works

There are 2 classes warn and error which are added to #jQueryProgressFormBar > div if some field is invalid to progress bar is added class warn if you have class warn and you try submit form, class is changing for error.

In case you want change color of fields use #jQueryProgressFormBar > div.warn and #jQueryProgressFormBar > div.error selector and change background

Author

Krzysztof Łokaj "Wokay"

formprogressbar's People

Contributors

victorwitkamp avatar

Watchers

 avatar

formprogressbar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.