Jquery short tricks


=> jQuery for select tomorrow’s date:

    jQuery("#deliverydate1").datepicker("setDate", "1");

=> jQuery validation for trim name and email: 
     
     var name1 = jQuery.trim(jQuery('input[name=name]').val());
     console.log("TRIM " + name1);

    var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|   [0-9]{1,3})(\]?)$/;

    console.log(jQuery.trim(jQuery('input[name=email]').val()).match(pattern) ? true : false);

Comments

Popular posts from this blog

Application ld json data in shopify

on_sent_ok not working in Contact Form 7 version 5.0.2

Make carousel slider in shopify