 i find that i end up consistently adding form validation to sites and for some reason i never made a plugin out of it i feel like every jquery validation plugin that i look at is way too bloated for what i really need so i finally whipped up a simple validation plugin that comes in at about 1 5kb i tried to keep it really simple with this plugin just check to see if a field that has been marked as required is not empty and check to see if an email address is valid if you want to skip ahead check out the demo and download the plugin from github start with the markup to get started i would always start with a simple form marked up in an ordered list form action= thanks htm method= post ol class= forms li label for= name em class= required em name label input type= text name= name id= name li li label for= email em class= required em email label input type= text name= email id= email li li label for= website website label input type= text name= website id= website li li label for= comment em class= required em comment label textarea name= comment id= comment textarea li li class= buttons button type= submit submit button li ol form then i need some way to denote which fields should be validated the html5 required attribute just isnt supported well enough to use so all that is needed is to add the class of required to each field that needs to be validated form action= thanks htm method= post ol class= forms li label for= name em class= required em name label input type= text name= name id= name class= required li li label for= email em class= required em email label input type= text name= email id= email class= required li li label for= website website label input type= text name= website id= website li li label for= comment em class= required em comment label textarea name= comment id= comment class= required textarea li li class= buttons button type= submit submit button li ol form since i have an email field i also need to add the class of email to the email field form action= thanks htm method= post ol class= forms li label for= name em class= required em name label input type= text name= name id= name class= required li li label for= email em class= required em email label input type= text name= email id= email class= required email li li label for= website website label input type= text name= website id= website li li label for= comment em class= required em comment label textarea name= comment id= comment class= required textarea li li class= buttons button type= submit submit button li ol form i also want to tell my plugin which forms to validate so ill also add a class to the form itself form action= thanks htm method= post class= required form ol class= forms li label for= name em class= required em name label input type= text name= name id= name class= required li li label for= email em class= required em email label input type= text name= email id= email class= required email li li label for= website website label input type= text name= website id= website li li label for= comment em class= required em comment label textarea name= comment id= comment class= required textarea li li class= buttons button type= submit submit button li ol form its javascript time get started by including jquery and my simple validate plugin then include them on the page script type= text javascript src= scripts jquery js script script type= text javascript src= scripts jquery simplevalidate min js script now i just need to call my plugin on any form that has required fields $ document ready function $ form required form simplevalidate just like that the form validation will work but i want to customize a few of the options first i want to change the error element to use an em tag instead of a strong tag $ document ready function $ form required form simplevalidate errorelement em then maybe i decide that i want to submit the form via ajax there is no need to add that kind of functionality into the plugin ajax is so easy with jquery so i just need to tell the plugin that im going to submit the form with ajax and then pass in my callback function which will fire once the form is submitted with no errors $ document ready function $ form required form simplevalidate errorelement em ajaxrequest true completecallback function $el var formdata = $el serialize do ajax request with formdata variable options here are all of the available options for the plugin errorclass error class for the error message text errortext label is a required field structure for the error message text label will be replaced with the associated label text emailerrortext please enter a valid label structure for the email error message text label will be replaced with the associated label text errorelement strong element to use for the error message text removelabelchar if there is an extra character in the label to denote a required field strip it out inputerrorclass class to add to an input when it is marked as having an error completecallback function to call once the form is error free ajaxrequest false if you dont want to use the default form action and want to submit it via ajax check out the demo and download the plugin from github let me know if you run into any bugs or have any feature requests 