{"id":70133,"date":"2021-08-27T04:10:04","date_gmt":"2021-08-27T08:10:04","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/javascript-form-validation-13\/"},"modified":"2021-08-27T04:10:04","modified_gmt":"2021-08-27T08:10:04","slug":"javascript-form-validation-13","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=70133","title":{"rendered":"Javascript &#8211; Form validation #13"},"content":{"rendered":"<p>The code will be helpful in validating data entry forms such as: user registration, user creation. validate_required is used by all other functions<\/p>\n<pre>function validate_required(field,alerttxt)   {       with (field)        {           if (value==null||value=='')         {               alert(alerttxt);return false            }           else {return true}      }   }       function validateTicketCreateForm(thisform) {       with (thisform)     {           if (validate_required(type,'Type must be filled out!')==false)          {type.focus();return false}                     if (validate_required(subject,'Subject must be filled out!')==false)            {subject.focus();return false}                              }   }   function validate_customer_create_form(thisform)    {       with (thisform)     {           if (validate_required(firstName,'First name must be filled out!')==false)           {firstName.focus();return false}                        if (validate_required(lastName,'Last name must be filled out!')==false)         {lastName.focus();return false}                     if (validate_required(phone,'Phone must be filled out!')==false)            {phone.focus();return false}                    }   }           function validateUserCreateForm(thisform)   {       with (thisform)     {                                   if (validate_required(firstName,'First name must be filled out!')==false)           {firstName.focus();return false}                        if (validate_required(lastName,'Last name must be filled out!')==false)         {lastName.focus();return false}                     if (validate_required(shortName,'Short name must be filled out!')==false)           {shortName.focus();return false}                        if (validate_required(username,'Username must be filled out!')==false)          {username.focus();return false}                                 if (validate_required(password,'Password must be filled out!')==false)          {password.focus();return false}                     if (password.value.length &lt; passwordLength.value) {alert(&quot;Password must be              at least &quot; + passwordLength.value +&quot; char long&quot;);    password.focus();return false}                      if (validate_required(password2,&#039;Please re-enter password!&#039;)==false)          {password2.focus();return false}                        if (password.value != password2.value)          {               alert(&quot;Password did not match&quot;);              password2.focus();              return false                        }                               }   }<\/pre>\n<p>From: http:\/\/sitestree.com\/?p=4778<br \/> Categories:13<br \/>Tags:<br \/> Post Data:2012-10-22 22:13:07<\/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>The code will be helpful in validating data entry forms such as: user registration, user creation. validate_required is used by all other functions function validate_required(field,alerttxt) { with (field) { if (value==null||value==&#8221;) { alert(alerttxt);return false } else {return true} } } function validateTicketCreateForm(thisform) { with (thisform) { if (validate_required(type,&#8217;Type must be filled out!&#8217;)==false) {type.focus();return false} if &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=70133\">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-70133","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":65792,"url":"http:\/\/bangla.sitestree.com\/?p=65792","url_meta":{"origin":70133,"position":0},"title":"JavaScript &#8211; Form validation #JavaScript","author":"Author-Check- Article-or-Video","date":"July 14, 2021","format":false,"excerpt":"The code will be helpful in validating data entry forms such as: user registration, user creati on. validate_required is used by all other functions function validate_required(field,alerttxt) { with (field) { if (value==null||value=='') { alert(alerttxt);return false } else {return true} } } function validateTicketCreateForm(thisform) { with (thisform) { if (validate_required(type,'Type must\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":70133,"position":1},"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":65806,"url":"http:\/\/bangla.sitestree.com\/?p=65806","url_meta":{"origin":70133,"position":2},"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":70009,"url":"http:\/\/bangla.sitestree.com\/?p=70009","url_meta":{"origin":70133,"position":3},"title":"A Sample PHP Class #16","author":"Author-Check- Article-or-Video","date":"August 23, 2021","format":false,"excerpt":"A sample PHP class is provided below. How the class is used? When the submit button from the interface (web-page) will be clicked the code in the form-action web-page will call the the create method (static) to create a Ticket data\/row in the database table Ticket. The method call 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":10564,"url":"http:\/\/bangla.sitestree.com\/?p=10564","url_meta":{"origin":70133,"position":4},"title":"JavaScript Code","author":"","date":"August 29, 2015","format":false,"excerpt":"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var browser=navigator.appName; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var b_version=navigator.appVersion; <a href=\"http:\/\/www.justetc.net\" target=\"_blank\"> <img border=\"0\" alt=\"hello\" src=\"b_pink.gif\" id=\"b1\" width=\"26\" height=\"26\" onmouseover=\"mouseOver()\" onmouseout=\"mouseOut()\" \/> Place the following code under script tag\/in a javascript file function mouseOver() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_blue.gif\"; } function mouseOut() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_pink.gif\"; } <map name=\"planetmap\"> <area shape =\"rect\" coords =\"0,0,82,126\"\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":[]},{"id":10548,"url":"http:\/\/bangla.sitestree.com\/?p=10548","url_meta":{"origin":70133,"position":5},"title":"Javascript : Miscellaneous Code","author":"","date":"August 29, 2015","format":false,"excerpt":"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var browser=navigator.appName; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var b_version=navigator.appVersion; <a href=\"http:\/\/www.justetc.net\" target=\"_blank\"> <img border=\"0\" alt=\"hello\" src=\"b_pink.gif\" id=\"b1\" width=\"26\" height=\"26\" onmouseover=\"mouseOver()\" onmouseout=\"mouseOut()\" \/> Place the following code under script tag\/in a javascript file function mouseOver() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_blue.gif\"; } function mouseOut() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_pink.gif\"; } <map name=\"planetmap\"> <area shape =\"rect\" coords =\"0,0,82,126\"\u2026","rel":"","context":"In &quot;Ajax&quot;","block_context":{"text":"Ajax","link":"http:\/\/bangla.sitestree.com\/?cat=1418"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70133","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=70133"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70133\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70133"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}