Tab automatic switch

linkaiyi
Follow

automatically switch to another tab using JQuery

Add the click event to tab dom eg. a tag element

$('#tab-two').trigger('click');

select input field in form

$("#form2 input[name=name]").val('Hello World!');

get url from form action

var formAction = $(this).attr("action");

password regex expression for check at least one upper letter, one lower letter and one digits

/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/

explained

/^
  (?=.*\d)          // should contain at least one digit
  (?=.*[a-z])       // should contain at least one lower case
  (?=.*[A-Z])       // should contain at least one upper case
  [a-zA-Z0-9]{8,}   // should contain at least 8 from the mentioned characters
$/

add customize method in jquery validator

$.validator.addMethod( "netmask", function( value, element ) {
    return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value );
}, "Please enter a valid netmask." );
Object has 0 attachments

Was this article helpful?

This article is viewed 12 times!

Recent Viewed Articles

Related Articles

0 Comments

Leave a Comment

Support