Posts

Showing posts from March, 2015

Email and Form validation using JS Example code

<!DOCTYPE html> <html> <head> <title> NEW YORK FOOD | NIGHTS</title> <link rel="stylesheet" type="text/css" href="css/style.css"> <link rel="ico" type="image/jpg" href="img/favicon.ico"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="js/jquery.validationEngine-en.js"></script> <script> function validateForm() {    var x = document.forms["myForm"]["email"].value;    var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/       if (!reg.test(x)) {               $("#demo").css("display","block");   } } </script> <style type="text/css"> #demo{ display:none; color:red; background: #ccc; } </style> </head>

Find length of given items in a table using jquery code (tooltips)

//Click button Event  $(".tabs-menu a").click(function(event) {                     $('.tab').hide(0, function(){                         $('#dvLoading').show(0, function(){                              $('.tab').delay(800).show(0,function(){                   $('#dvLoading').hide();                   });                 });            });         var tab_id = $(this).attr("href");                var map = {}, array = [];         var $tds = $(" "+tab_id+" table tr ").slice(1).find('td:nth-child(5) span').each(function () {             var data = $(this).text();             var arr = data.split('$');             var value=parseInt(arr[1]);                        if (map[value]) {                 map[value].push(this);             } else {                 map[value] = [this];                 array.push(value);             }         })