7,2%
$129,920
Last Month
0,6%
$14,293
Today
0,8%
$190,250
Last Week
3,2%
$10,250
Last Hour
Fast21 80%
Eco Newmars 70%
Best Niket 60%
Real Five 40%

Validators

Custom styles

Please provide a valid city.
Please provide a valid state.
Please provide a valid city.
Please provide a valid state.
// Example starter JS for disabling form submissions if there are invalid fields
(function() {
  "use strict";
  window.addEventListener("load", function() {
    var form = document.getElementById("needs-validation");
    form.addEventListener("submit", function(event) {
      if (form.checkValidity() == false) {
        event.preventDefault();
        event.stopPropagation();
      }
      form.classList.add("was-validated");
    }, false);
  }, false);
}());

Browser defaults

Please provide a valid city.
Please provide a valid state.
Please provide a valid city.
Please provide a valid state.

Server side

Please provide a valid city.
Please provide a valid state.
Please provide a valid city.
Please provide a valid state.

Supported elements

Please enter a message in the textarea.

Example invalid feedback text

More example invalid feedback text

Example invalid custom file feedback
Please enter a message in the textarea.
Example invalid feedback text
More example invalid feedback text
Example invalid custom file feedback

jQuery Validation

$("#commentForm").validate();

Advanced jQuery Validation

$("#signupForm").validate({
rules: {
  firstname: "required",
  lastname: "required",
  username: {
    required: true,
    minlength: 2
  },
  password: {
    required: true,
    minlength: 5
  },
  confirm_password: {
    required: true,
    minlength: 5,
    equalTo: "#password"
  },
  email: {
    required: true,
    email: true
  },
  topic: {
    required: "#newsletter:checked",
    minlength: 2
  },
  agree: "required"
  },
  messages: {
    firstname: "Please enter your firstname",
    lastname: "Please enter your lastname",
    username: {
      required: "Please enter a username",
      minlength: "Your username must consist of at least 2 characters"
    },
    password: {
      required: "Please provide a password",
      minlength: "Your password must be at least 5 characters long"
    },
    confirm_password: {
      required: "Please provide a password",
      minlength: "Your password must be at least 5 characters long",
      equalTo: "Please enter the same password as above"
    },
      email: "Please enter a valid email address",
      agree: "Please accept our policy"
    }
  });

  // propose username by combining first- and lastname
  $("#username").focus(function() {
    var firstname = $("#firstname").val();
    var lastname = $("#lastname").val();
    if (firstname && lastname && !this.value) {
      this.value = firstname + "." + lastname;
    }
  });

  //code to hide topic selection, disable for demo
  var newsletter = $("#newsletter");
  
  // newsletter topics are optional, hide at first
  var inital = newsletter.is(":checked");
  var topics = $("#newsletter_topics")[inital ? "removeClass" : "addClass"]("gray");
  var topicInputs = topics.find("input").attr("disabled", !inital);
  
  // show when newsletter is checked
  newsletter.on('click', function() {
    topics[this.checked ? "removeClass" : "addClass"]("gray");
    topicInputs.attr("disabled", !this.checked);
  });
});

Errors Within Labels

var validator = $("#form1").validate({
  errorPlacement: function(error, element) {
    
    // Append error within linked label
    $( element )
      .closest( "form" )
      .find( "label[for='" + element.attr( "id" ) + "']" )
        .append( error );
        },
        errorElement: "span",
        messages: {
          user: {
            required: " (required)",
            minlength: " (must be at least 3 characters)"
          },
          password: {
            required: " (required)",
            minlength: " (must be between 5 and 12 characters)",
            maxlength: " (must be between 5 and 12 characters)"
    }
  }
});

Container jQuery Validation

There are serious errors in your form submission, please see below for details.


There are serious errors in your form submission, please see below for details.

var container = $('div.container-validator');

// validate the form when it is submitted
var validator = $("#form2").validate({
    errorContainer: container,
    errorLabelContainer: $("ol", container),
    wrapper: 'li'
});