Giter Club home page Giter Club logo

stepy's Introduction

jQuery Stepy - A Wizard Plugin

Build Status NPM Version Dependency Dev Dependency Code Climate Support

jQuery Stepy is a plugin that generates a customizable wizard.

Options

back:        undefined  // Callback before the backward action.
block:       false      // Block the next step if the current is invalid.
description: false      // Choose if the descriptions of the titles will be showed.
duration:    0          // Duration of the transition between steps in ms.
enter:       true       // Enables the enter key to change to the next step.
errorImage:  false      // If an error occurs, a image is showed in the title of the corresponding step.
finish:      undefined  // Callback before the finish action.
finishButto: true       // Include the button with class called '.finish' into the last step.
header:      true       // Creates a header with title and description.
ignore:      ''         // Choose the fields to be ignored on validation.
legend:      false      // Choose if the legends of the steps will be showed.
next:        undefined  // Callback before the forward action.
select:      undefined  // Callback executed when the step is shown.
titleClick:  true       // Active the back and next action in the titles.
titleTarget: undefined  // Choose the place where titles will be placed.
transition:  'hide'     // Use transition between steps ('hide', 'fade' or 'slide').
validate:    undefined  // Callback to each field of each step.

Usage

<form>
  <fieldset title="Step 1" class="stepy-step">
    <legend class="stepy-legend">description one</legend>

    <!-- inputs -->
  </fieldset>

  <fieldset title="Step 2" class="stepy-step">
    <legend class="stepy-legend">description two</legend>

    <!-- inputs -->
  </fieldset>

  <a class="stepy-back">back</a>
  <a class="stepy-next">next</a>
  <input type="submit" class="stepy-finish" />
</form>
$('form').stepy();

Functions

$('form').stepy('step', 2); // Changes the form to the second step.

$('form').stepy('destroy'); // Destroy the Stepy's bind and gives you the raw element.

Contributors

Check it out

Love it!

Via PayPal or Support. Thanks! (:

stepy's People

Contributors

gog0 avatar legigor avatar m3nd3s avatar mpdroog avatar r-f-a avatar tigraine avatar victorhqc avatar wbotelhos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stepy's Issues

https://wbotelhos.com/stepy is Error 502

I was check your site https://wbotelhos.com/stepy for appreciate your examples but show me the next error message:
"Error 502 Ray ID: 45769beb6ac0b70b • 2018-09-09 03:36:10 UTC
Bad gateway".
"Cloudflare Ray ID: 45769beb6ac0b70b • Your IP: 179.5.230.156 • Performance & security by Cloudflare"

Multiple stepy instances

Cannot have Multiple stepy instances when using bootsrap specifically inside modals
even though different classes are specified

Field focus when error found

Currently, it only focus on the first field even though the field does not contain error. Preferably, it should focus on the first field that contain error

Validation plugin tires to validate all enabled elements

When a step is active most of the time its just that step that needs to be validated so you can change the line

$($step.find(':input:enabled').get().reverse()).each(function ()

to read

$($step.find(':input:enabled').not(":hidden").get().reverse()).each(function ()

This will only validate visible elements and not hidden steps. If you want more flexibility add a flag to properties for validatehidden:false and if someone wants that function they can set it to true (but i cant see any point of validating hidden fields)

Cannot read property 'name' of undefined

Sometimes when skipping a step with checkboxes in it, the validation will return an error:
Uncaught TypeError: Cannot read property 'name' of undefined

I'm not sure why this happens, the field does have the property 'name', but I solved it by an extra try/catch on line 290:

try {var fieldIsValid = $validate.element($(this));}catch (error){}

I get no transition

The stepy Works nice,

but i don't have a transition:

$('.formgen').stepy({
  backLabel:      'Zurück',
  block:          true,
  errorImage:     true,
  nextLabel:      'Nächster Abschnitt',
  titleClick:     true,
  validate:       true,
  duration  : 1400,
transition: 'fade'

});

Add decent API documentation

This library currently has really limited and outdated documentation. It would be helpful if the author could expand on this documentation.

F.E. the library seems to expect & class ".stepy-finish" on a submit button, but the demo does not reflect this.

New features to next version

Some features planned next:

  • Returning length of steps on back and next callback;
  • Support to custom navigator, instead use our own;
  • Adding a progress bar;
  • Removing dependency of use a <form/>;

Not support of H5F validation plugin

To add support of excellent H5F validation plugin in Stepy, just add this code:

jQuery.extend ({
        validator: {
                setDefaults: function () {
                    }
            }
    });
jQuery.fn.extend ({
        validate: function () {
                return {
                        element: function (field) {
                                return field.get (0).checkValidity ();
                            },
                        focusInvalid: function () {
                            }
                    }
            }
    });

PS: i think H5F is better than jquery validator plugin because it respect more the HTML5 syntax, so it will be easier to maintain source code when HTML5 will be fully supported by browsers

step click not working for steps greater than 10

In case we have more than 10 steps, the following happens:

  1. When I tried to browse to any step greater than 10 via the next and back buttons, it works fine.
  2. When I tried to click on the links to go directly to any step greater than 10, it would repeatedly take me back to step 2.

Thanks,
Neha

No jump back to invalid step when submitting form

When submitting a form containing invalid fields in previous steps, plugin will not jump back to bad step, like back and next buttons do!

This situation can occur when a field is under Ajax checking, so answer is delayed.

Click on steps titles and load content using AJAX calls

Hi, I've two doubts about your plugin:

1 - It's possible to display step content on title click? If so, how?
2 - How do I know in which step I'm in order to load some content using AJAX calls?

PS: amazing plugin man, thanks for your hard work

Cannot read property 'errorImage' of undefined

It looks like stepy is throwing:

$(step.find(':input:enabled').get().reverse()).each(function() {
        var fieldIsValid = $validate.element($(this));

        if (fieldIsValid === undefined) {
          fieldIsValid = true;
        }

        isValid &= fieldIsValid;

        if (isValid) {
          if (self.opt.errorImage) { <--- This line
            $title.removeClass('stepy-error');
          }
        } else {
          if (self.opt.errorImage) {
            $title.addClass('stepy-error');
          }

          $validate.focusInvalid();
        }
      });

Frankly, I'm unsure what I'm doing on my form setup that would cause this?

Using "Enter" moves the wizard to the last step

If you have a wizard with option "block" enabled and hit enter on the first step form the wizard moves to the last steps and validates the whole form. It would be better to move to the next step only!

Disabled fields are not tested

Disabled fields are not tested, but in fact they should be!
1- in some cases, fields can be disabled while analyzing the input with Ajax!
2- a disabled field should contain a correct input in any case!

You should modify this line:
$($step.find(':input:enabled').get().reverse()).each(function() {

or add an option to test disabled fields

Thanks

How to move steps on the success of a Ajax call?

jQuery('#custom').stepy({
back: function (index) {
var answer = confirm('Do you want to go to previous page? you may lose data of current page.');
if (!answer) {
return false;
}
}, next: function (index) {
if (!jQuery("#custom").validationEngine('validate') && index == "2") {
return false;
}

                var f = jQuery("#custom");
                var serializedform = f.serialize();
                //preloader();
                jQuery.post("/AdminNew/FrameAddjson", serializedform + '&indexval=' + index + '',
                       function (data, status) {
                           var frameid = data;
                           if (status == "success" && index == "2") {
                               alert("Frame added successfully");
                           }
                       });
            },
            select: function (index) {
            },
            finish: function (index) {
                if (!jQuery("#custom").validationEngine('validate')) {
                    return false;
                }
            },
            titleClick: true
            //validate: true
        });

minified version

Just letting you know when downloading the zip, the minified version is empty.

Stepy wizard with Jquery validation or Parsley validation

I used stepy for our wizard. I want to validate each element inside each field.
If all values entered means it should go to other field. else it should alert and return false?
How to accomplish this?
I have two validation plugins to be integrated with stepy. [Jquery Validation plugin or Parsley JS]

Note: I have gone through the documentation. I cant find exact hack of implementing it.

How to show/hide steps on the fly

Hi, its possible to show/hide steps on the fly? What I want to do is if I mark a checkbox (checked = true) then I should add a step between 1 and 2, it's possible? How?

_bindFinish fails on Firefox

With v1.1.0 under Firefox, if the option finishButton is true, then the _bindFinish method is called... however the var finish won't be assigned to the 'submit' button, line #132

finish = that.children('input[type="submit"]');

finish will be set to null, but a jQuery alternative is

finish = $(':submit',that);

Problem with Google maps

Hi,
I really like this wizard plugin. I start to implement in my site, but I meet troubles with google maps.
When plugin is activated, map is not shown in whole window, but if I switch off stepy, maps is showing OK.
I attached pictures. Can you please check it, if is it possible to solve some-how?
Thank you very much.
google-maps-issue

How to validate the current step

In your examples at http://wbotelhos.com/stepy one can see that you have something like:

$('#step').stepy({
    next: function(index) {
        if (!isValid()) {
          alert('Invalid random value!');
          return false;
        }
        alert('Going to step ' + index + '...');
   }
});

but I get an error that isValid() is not defined, tried to find in the source code and there is no such method to be called publicly. How can I validate the current step?

Multi call :(

not work

$('#frm1').stepy({
backLabel: 'Назад',
nextLabel: 'Далее',
legend: false
});

$('#frm2').stepy({
backLabel: 'Назад',
nextLabel: 'Далее',
legend: false
});

$('#frm3').stepy({
backLabel: 'Назад',
nextLabel: 'Далее',
legend: false
});

Uploading image is not working

@wbotelhos , thank for this amazing plugin.

Actually, I am working on uploading an image in stepy but I am unable to get it. Could you please tell me how can I upload image?

Looking forward to you quick reply.

default step when using validation and advanced options ?

how can i change the default step when using validation and advanced options ?

if i use something like this and i want to go to step 2 by default

$('#registration-form').stepy({
    block: true,
    description: false,
    finishButton: true,
    legend: false,
    titleClick: true,
    validate: true,
    step:2
});

won't work

if i use

$('#registration-form').stepy('step', 2);

it works but validation is lost

Validation don´t work on $('form').stepy('step', 2)

I am using stepy in a research form. The user can leave the form any time and return later in the last step. For user return I am using this:

$('form').stepy('step', "step number") *step number is a real number not the string "step number"

It´s working fine, but the problem is that validation doesn´t work anymore after that.

support for other validation engines

Hi,

I am currently working on a personal project in which all my forms are validated using the validator engine from https://github.com/posabsolute/jQuery-Validation-Engine.

I just tried stepy in the project and it works marvelously well. my only problem is that it disables my validation plugin. Can you make it possible to support different kinds of validation plugins like the one am using or give me ideas on how to be able to get my validation plugin to work with stepy?

thank you.

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.