Giter Site home page Giter Site logo

gustaflindqvist / jquery-form-validator-rails Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 15.0 113 KB

jQuery Form Validator is a feature rich jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. See more http://formvalidator.net

License: Other

Ruby 1.27% JavaScript 75.45% HTML 23.29%

jquery-form-validator-rails's Introduction

Jquery::Form::Validator::Rails

Jquery-form-validator-rails gem is based on Victor Jonsson's jQuery plugin: https://github.com/victorjonsson/jQuery-Form-Validator

Installation

Add this line to your application's Gemfile:

gem 'jquery-form-validator-rails'

And then execute:

$ bundle

Add jquery-form-validator-rails to your Gemfile and run bundle install:

gem "jquery-form-validator-rails"

Include jquery.form-validator-rails javascript assets

Add the following to your app/assets/javascripts/application.js:

//= require jquery.form-validator

Easy example

Example how to add Jquery Form Validator to FormHelper text_field:

<div class="controls">
  <%= f.text_field(:example, class: "field", data: {
      :validation => "required validate_max_length length50",
      "validation-error-msg" => "This field is required and cannot be longer than 50 characters."
    }) %>
</div>

Then add following to your app/assets/javascripts/application.js

<script>
  $(document).ready(function() {
    $.validate();
  });
</script>

Other configuration options can be seen here: http://formvalidator.net/#configuration

Added modules:

  • security
  • date
  • location
  • file
  • sweden
  • uk

The following code shows you how to load the module.

<script>
  $.validate({
    modules : 'security'
  });
</script>

Read the documentation for the modules at http://formvalidator.net

Changes

See CHANGELOG.md in this repository for detailed changes.

Contributing makes this repo happy!

Please just hop in and help out! ๐Ÿ˜„

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

jquery-form-validator-rails's People

Contributors

gustaflindqvist avatar louishoang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jquery-form-validator-rails's Issues

Rails5

When upgrading from Rails4 to Rails5 it says:

jquery-form-validator-rails java was resolved to 0.0.1, which depends on
railties (< 5.0, >= 3.2) java

Does it not work with rails5?

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.