Giter Club home page Giter Club logo

form-pager's Introduction

Form Pager

A simple, single-page, form pagination template shell (using jQuery).

This is not a plugin. Honestly, the code isn’t pretty. One of these days I’ll clean things up.

Depends on

  1. jQuery
  2. jQuery Validate

Preview

Check out the demo: https://mhulse.github.io/form-pager


To the extent possible under law, @mhulse has waived all copyright and related or neighboring rights to this work.

:octocat:

form-pager's People

Contributors

mhulse avatar

Stargazers

Angus H. avatar

Watchers

 avatar

form-pager's Issues

Make more portable

As it stands currently, this code works best as an independent app. Need to make the code more portable so it can be dragged/dropped into other projects (e.g., a component of an app).

Return key form submission supressor

Return key will submit form if a field is focused. Would like to stop this from happening.

Something like:

$('#formid').on('keyup keypress', function(e) {
  var keyCode = e.keyCode || e.which;
  if (keyCode === 13) { 
    e.preventDefault();
    return false;
  }
});

Related: #3

History

Option to add history to URL for page-by-page navigation/linking.

Cookies

Add ability to remember selections.

Validation bug: Page continues without required field being filled in

issue with the weight required field being blank and NOT causing the page to stop until it is

however, it IS recognized because an error message pops up when it is blank

<section id="p6" class="step">
    <h3>Your height and weight</h3>
    <p class="wave">What is your height?</p>
    <div class="pure-control-group">
        <label>
            <input type="number" id="p6-1" name="" min="1" max="12" required> feet,
        </label>
        <label>
            <input type="number" id="p6-2" name="" min="0"> inch(es)
        </label>
    </div>
    <p class="wave">What is your weight (in pounds)?</p>
    <div class="pure-control-group">
        <label>
            <input type="number" id="p6-3" name="" min="1" max="500" required> pounds
        </label>
</section>

Jump to top on page change

var top = function() {

    $(document).scrollTop(0);

};
// ...
$next.click(function(){

    top();

});

$back.click(function() {

    top();

});

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.