{"id":70135,"date":"2021-08-27T04:10:05","date_gmt":"2021-08-27T08:10:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/javascript-miscellaneous-validations-13\/"},"modified":"2021-08-27T04:10:05","modified_gmt":"2021-08-27T08:10:05","slug":"javascript-miscellaneous-validations-13","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=70135","title":{"rendered":"JavaScript &#8211; Miscellaneous Validations #13"},"content":{"rendered":"<pre>    function validateDomainName(strValue)   {       return \/www.[a-z0-9_-]+.[a-z]{2, 3}\/ig.test(strValue);          }   function validateDomainName(strValue)   {       return \/www.[a-z0-9_-]+.[a-z]{2, 3}\/ig.test(strValue);          }   \/\/not 100% right, will fix later    function checkDateFormat()  {       var pattern = new RegExp(0|1[0-9]\/[0-3][0-9]\/[0-9][0-9]);       if(document.getElementById('timestampStarted').value.match(pattern))        {           var date_array = document.getElementById('timestampStarted').value.split('\/');                      var month = date_array[0];          var day = date_array[1];            var year = date_array[2];           \/\/ This instruction will create a date object           source_date = new Date(year,month,day);             if(month != source_date.getMonth())         {               alert('Month is not valid!');               return false;           }               if(day != source_date.getDate())            {               alert('Day is not valid!');             return false;           }                       if(year != source_date.getYear())           {               alert('Year is not valid!');                return false;           }       }       else        {           alert('Date format is not valid!');         return false;       }           return true;    }   function validateEmail( strValue)   {       var objRegExp  = \/(^[a-z]([a-z_.]*)@([a-z_.]*)([.][a-z]{3})$)|(^                [a-z]([a-z_.]*)@([a-z_.]*)(.[a-z]{3})(.[a-z]{2})*$)\/i;          \/\/check for valid email         return objRegExp.test(strValue);    }   \/\/AJAX Example  function ajaxFunctionGeneral()  {       var page_request = false        if (window.XMLHttpRequest) \/\/ if Mozilla, IE7, Safari etc           page_request = new XMLHttpRequest()     else if (window.ActiveXObject)      { \/\/ if IE          try             {               page_request = new ActiveXObject(\"Msxml2.XMLHTTP\")          }           catch (e)           {               try             {                   page_request = new ActiveXObject(\"Microsoft.XMLHTTP\")               }               catch (e)               {               }           }       }       else                    return false        return page_request;    }   function reboot(deviceId)   {       var response=confirm('Are you sure to reboot');             if(!response)           exit;               page_request = ajaxFunctionGeneral();       if (!page_request) return false;                page_request.onreadystatechange=function()      {       if(page_request.readyState==4)          {               var response=page_request.responseText;             var displayArea = document.getElementById('showDiagnosticsResults');                displayArea.value = response;           }      }        page_request.open('GET', '\/Inventory\/Diagnostics\/reboot.php?deviceId='+deviceId, true)      page_request.send(null) }<\/pre>\n<p>From: http:\/\/sitestree.com\/?p=4779<br \/> Categories:13<br \/>Tags:<br \/> Post Data:2008-12-29 21:43:54<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>function validateDomainName(strValue) { return \/www.[a-z0-9_-]+.[a-z]{2, 3}\/ig.test(strValue); } function validateDomainName(strValue) { return \/www.[a-z0-9_-]+.[a-z]{2, 3}\/ig.test(strValue); } \/\/not 100% right, will fix later function checkDateFormat() { var pattern = new RegExp(0|1[0-9]\/[0-3][0-9]\/[0-9][0-9]); if(document.getElementById(&#8216;timestampStarted&#8217;).value.match(pattern)) { var date_array = document.getElementById(&#8216;timestampStarted&#8217;).value.split(&#8216;\/&#8217;); var month = date_array[0]; var day = date_array[1]; var year = date_array[2]; \/\/ This instruction will create a date object source_date &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=70135\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-70135","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":65804,"url":"http:\/\/bangla.sitestree.com\/?p=65804","url_meta":{"origin":70135,"position":0},"title":"JavaScript &#8211; Miscellaneous Validations #JavaScript","author":"Author-Check- Article-or-Video","date":"July 15, 2021","format":false,"excerpt":"function validateDomainName(strValue) { return \/www.[a-z0-9_-]+.[a-z]{2, 3}\/ig.test(strValue); } function validateDomainName(strValue) { return \/www.[a-z0-9_-]+.[a-z]{2, 3}\/ig.test(strValue); } \/\/not 100% right, will fix later function checkDateFormat() { var pattern = new RegExp(0|1[0-9]\/[0-3][0-9]\/[0-9][0-9]); if(document.getElementById('timestampStarted').value.match(pattern)) { var date_array = document.getElementById('timestampStarted').value.split('\/'); var month = date_array[0]; var day = date_array[1]; var year = date_array[2]; \/\/ This instruction will\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65806,"url":"http:\/\/bangla.sitestree.com\/?p=65806","url_meta":{"origin":70135,"position":1},"title":"JavaScript Codes #JavaScript","author":"Author-Check- Article-or-Video","date":"July 15, 2021","format":false,"excerpt":"JavaScript is a very powerful scripting language for web-site development. Also, it is in much demand. var serviceInstancesArrAtLoad = Array(); var serviceInstancesArrAtSubmit = Array(); var tempArr=Array(); function validate_required(field,alerttxt) { with (field) { if (value==null||value=='') { alert(alerttxt);return false } else {return true} } } function validateTicketCreateForm(thisform) { with (thisform) { if\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70137,"url":"http:\/\/bangla.sitestree.com\/?p=70137","url_meta":{"origin":70135,"position":2},"title":"Javascript Codes #13","author":"Author-Check- Article-or-Video","date":"August 27, 2021","format":false,"excerpt":"Javascript is a very powerfull scripting language for web-site development. Also, it is in much demand. In Europe Javascript experts earn 29-58 pound\/hour [ref: Internet] var serviceInstancesArrAtLoad = Array(); var serviceInstancesArrAtSubmit = Array(); var tempArr=Array(); function validate_required(field,alerttxt) { with (field) { if (value==null||value=='') { alert(alerttxt);return false } else {return true}\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69880,"url":"http:\/\/bangla.sitestree.com\/?p=69880","url_meta":{"origin":70135,"position":3},"title":"Automating Digital Delivery with Paypal Payment Processing System #19","author":"Author-Check- Article-or-Video","date":"August 21, 2021","format":false,"excerpt":"In the past, I implemented an automatic notification and digital product delivery system with Paypal Payment Processing System. The concept is, when a person buys products from your web-sites, he gets his products automatically as email attachments after you have confirmed the transaction. The most important part is - collecting\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67720,"url":"http:\/\/bangla.sitestree.com\/?p=67720","url_meta":{"origin":70135,"position":4},"title":"Automating Digital Delivery with Paypal Payment Processing System #Classic ASP","author":"Author-Check- Article-or-Video","date":"July 27, 2021","format":false,"excerpt":"Brought from: http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=1283&title=Automating%20Digital%20Delivery%20with%20Paypal%20Payment%20Processing%20System the time-period: 2007 - 2008 In the past, I implemented an automatic notification and digital product delivery system with Paypal Payment Processing System. The concept is, when a person buys products from your web-sites, he gets his products automatically as email attachments after you have confirmed the\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10560,"url":"http:\/\/bangla.sitestree.com\/?p=10560","url_meta":{"origin":70135,"position":5},"title":"JavaScript Form Validation: Validate a Form Collecting Credit Card Information","author":"","date":"August 29, 2015","format":false,"excerpt":"\u00a0\u00a0 \u00a0function validateCollectPaymentInformationForm() \u00a0\u00a0 \u00a0{ \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0var method, name, number, expiry, errMsg \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0errMsg = \"\"; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0method = document.getElementById('paymentMethod'); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0name =\u00a0\u00a0 document.getElementById('txtCCName'); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0number = document.getElementById('txtCCNumber'); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0if (method.value == \"\" || method.value ==\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70135"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70135\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70135"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}