npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bootstrap-modal-ajax-form-2

v0.0.23

Published

Bootstrap modal ajax forms and confirmation modals.

Readme

Boostrap modal form ajax handler

Using this library, you can easily:

  • Create ajax based modal forms
  • Display modal confirmations with custom messages
  • Load modal content dynamically

This library depends on Bootstrap ~3.3, Bootstrap modal library and jQuery > 1.9.

Installiation

You can install this library using Bower:

bower install bootstrap-modal-form

Or download latest release from GitHub:

https://github.com/DATA-DOG/bootstrap-modal-form/archive/master.zip

Do not forget to load downloaded script into your webpage!

Usage

  • To load modal using ajax, simply add class .js-modal and provide data-url tag for any element.

    Example:

    <a href="#" data-url="/myModalContent" class="js-modal">Open Modal</a>

    /myModalContent should return status code 200, with modal content. Example response template:

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
      <h4 class="modal-title">Test Modal</h4>
    </div>
    
    <div class="modal-body">
      <form action="/formAction" method="post" class="js-form">
        <input type="text" name="test">
    
        <button type="submit" class="btn btn-primary">
          Submit
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal">
          Cancel
        </button>
      </form>
    </div>

    To submit forms and display result in same modal, just add .js-form class to your form! It's that simple. Returned template (from /formAction) should include handled form, with all errors rendered.

    If you want to redirect user after form submit, return response with status code 201 and body:

    {"redirect": "http://myRedirectLink.com"}
  • To display confirmation modals, just add .js-confirm to any element, and optionally provide data-title (for title), and data-text (for modal content) attributes.

    Example:

    <a href="/update" data-text="Do you want to update?" data-title="Update member #1">
      Update
    </a>

    Confirming modal will send AJAX request to element href, if you do not want that (you need a redirect), add .js-no-ajax class to that element.

Overwriting templates

This library injects default templates. If you want to customize them, add following elements to body, and change them for your needs.

<div id="bsModalContent" class="hidden">
  <div class="modal-body">
    Loading...
  </div>
</div>

<div id="bsModalConfirmContent" class="hidden">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
      <span aria-hidden="true">&times;</span>
    </button>
    <h4 class="classic-title" id="bsModalTitle"></h4>
  </div>
  <div class="modal-body"></div>
</div>

<div id="bsModalConfirmButtons" class="hidden">
  <div class="clearfix">
    <button class="btn-system btn-large js-confirm-btn">Confirm</button>
    <button type="button" class="btn-system btn-large border-btn" data-dismiss="modal">
      Cancel
    </button>
  </div>
</div>