Minimal jQuery Validation Plugin

denetmen.js is a minimal jQuery form validation plugin which checks if text fields are empty with custom alert messages and optional lightbox integration.

How to use it:

1. Download and place the main JavaScript file denetmen.js after jQuery library, just before the closing body tag.

<script src="//code.jquery.com/jquery-3.1.0.slim.min.js"></script>
<script src="src/denetmen.js"></script>

2. Use the data-denetmen attribute to specify the custom error message when the input field is empty before submitting.

<input type="text" name="name" data-denetmen="Please enter a name!" placeholder="Name...">

3. Call the plugin on the html form and we’re done.

$("form").denetmen();

4. Integrate with the Bootstrap modal (Requires Bootstrap framework).

$("form").denetmen({
  modal: {
    title: "Oppss!",
    button: "Okey",
    buttonClass: "success",
    fade: true
  }
});

5. More configuration options.

$("form").denetmen({

  // target text field
  item: "denetmen",

  // default alert message
  default: "Not entered value!",

  // highlights the invalid field
  highlight: true,

});

 

 

Demo     Download

Minimal jQuery Validation Plugin

| jQuery Form Validation, jQuery Plugins, Slider | 0 Comments
About The Author
-