Skip to content
a jquery plugin for simple login form validation
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
cover.jpg
validify.css
validify.js

README.md

validify.js

a jquery plugin for simple login form validation

alt tag

Demo: http://projects.emretekince.com/validifyjs/demo.html

Installation

  • Extract files
  • Add validify.js and validify.css to your project and make sure that you have jQuery in your project.
  • Call the plugin with $("#example-form").validify();

Options

Options for plugin.

errorStyle CSS class for textbox when it's invalid. Default: validifyError

successStyle CSS class for textbox when it's valid. Default: validifySuccess

emailField Name of e-mail field to special check. Default : input[name='email']

emailCheck Enables checking for email field. Default : true

requiredAttr HTML tag which defines field is required. Default : required

Events

onSubmit Callback when the form is submitted.

onFormSuccess Callback when the form is valid.

onFormFail Callback when the form is invalid.

Example

Form

<form  id="demo" >
	<div class="form-group">
		<input type="email" class="form-control textbox" name="email" required placeholder="e-mail">
	</div>
	<div class="form-group">
		<input type="password" class="form-control textbox" required placeholder="pass">
	</div>
	<div class="form-group">
		<button class="btn btn-default btn-osx btn-lg"  type="submit"><i class="fa fa-arrow-circle-right"></i></button>
	</div>
	<div class="alert alert-success hidden" role="alert">Successfully</div>
</form>

Javascript

$("#demo").validify({
	onSubmit: function (e, $this) {
		$this.find('.alert').removeClass('hidden')
	},
	onFormSuccess: function (form) {
		console.log("Form is valid now!")
	},
	onFormFail: function (form) {
		console.log("Form is not valid :(")
	}
});

License: Do whatever you want with this

You can’t perform that action at this time.