Quick jQuery Form Validation

If you want a quick validation of your form without using any validation plugin, this jQuery snippet could do the trick. This snippet will prevent form submit and change field border color to red, unless user corrects the invalid or empty fields.$(document).ready(function() { $("#my_form").submit(function(e) { //loop through each required field and simply change border color to red for invalid fields $("#my_form input[required=true], #my_form select[required=true], #my_form textarea[required=true]").each(function(){ var proceed = true; $(this).css('border-color',''); //reset border color if(!$.trim($(this).val())){ //if this field is empty $(this).css('border-color','red'); //change border color to red //alert("Field is empty"); proceed = false; //set do not proceed flag } //check invalid email var email_reg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if($(this).attr("type")=="email" && !email_reg.test($.trim($(this).val()))){ $(this).css('border-color','red'); //change border color to red proceed = false; //set do not proceed flag } if(proceed){ //everything looks good return; //submit form } e.preventDefault(); }); }); });Usage Just set your form id to “my_form” and add required attribute to each input field you want to validate, as shown in example below.

30 Pure CSS3 Tutorials & Examples

CSS3 contains several new important features to enhance your designes, it has completly opened new posibilities for designers. With CSS3 and HTML5, one can now create extremely modern and very stylish web designes, loaded with effects and animations. But CSS3 selectors are relatevily new and are not supported in older browser, especially the older Internet Explorer versions. Click here to see visual display of HTML5 and CSS3 support.

60+ Free Quality WordPress themes

Ordinary free themes are easy to find, but most of them are just junk and old. Finding some free high-quality WordPress themes can be a difficult task. I’ve been searching for good set of free quality WordPress themes, and I came across many good looking themes, it was nice to find all new premium quality WordPress themes and absolutely free to use in any WordPress site. 

Olx Free Classifieds

OLX.in is your solution if you are looking for selling electronics, DVDs, mobile phones, video games and many more. The platform sorts products by category, by cities, by states and by most popular to increase functionality.