Disable Google 2-step verification
Google 2-step verification is secure but it can be very annoying at some point, when you need to enter verification code every-time your change your computer. Especially when you travel outside, where your mobile goes dead, internet is short and you try to access Gmail from cyber-cafe or your colleague computer. This kind of situations are less likely these days, but sometimes you just want to disable this Google service for various reasons.
Generate Google Application-specific passwords
If you have activated Google Add 2-step verification, you may experience network or timed-out Errors in your Android, BlackBerry, iPhone or other smartphone devices, because Google 2-step verification is not yet compatible with the applications running on those devices. To sign-in to your Google account normally from those devices you must generate an application-specific password.
How to activate Google 2-step verification
Normal password protection looks strong enough but in today’s world, internet is a totally different place. There are people who go to great lengths to access others account and seal valuable information. There are many methods such as guessing passwords, using programs or sending phishing e-mails etc. That’s why Google introduced extra layer of security to your Google accounts called 2-step verification. Lets learn how to enable it.
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.