{"id":1431,"date":"2013-05-22T05:53:31","date_gmt":"2013-05-21T19:53:31","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1431"},"modified":"2013-05-22T05:53:31","modified_gmt":"2013-05-21T19:53:31","slug":"javascript-form-validation-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/javascript-form-validation-primer-tutorial\/","title":{"rendered":"Javascript Form Validation Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Javascript\/FormValidation\/validate.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Javascript Form Validation Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Javascript\/FormValidation\/Form_Validation_Primer.jpg\" title=\"Javascript Form Validation Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Javascript Form Validation Primer Tutorial<\/p><\/div>\n<p>In tutorial here we use Javascript code to validate an HTML form element&#8217;s input tag data using regular expressions, as described by <a target=_blank title='Regular expressions' href='http:\/\/en.wikipedia.org\/wiki\/Regular_expression'>Wikipedia<\/a> below:<\/p>\n<blockquote><p>In computing, a regular expression (abbreviated regex or regexp) is a sequence of text characters, some of which are understood to be metacharacters with symbolic meaning, and some of which have their literal meaning, that together can automatically identify textual material of a given pattern, or process a number of instances of it that can vary from a precise equality to a very general similarity of the pattern. The pattern sequence itself is an expression that is a statement in a language designed specifically to represent prescribed targets in the most concise and flexible way to direct the automation of text processing of general text files, specific textual forms, or of random input strings. A regular expression patterns a match to a string. It is employed in a search to identify text for further processing, such as displaying the match, or altering it; or it is employed to simply inform of the location or count. The concept arose in the 1950s, when Kleene formalized the description of a regular language, and came into common use with the Unix text processing utilities ed, an editor, and grep (global regular expression print), a filter.<\/p><\/blockquote>\n<p>This Javascript form validation client-side technique uses a GET method, but if you want to hide your data and use a POST method, you may need to do form validation from the server-side using  <a target=_blank title='Alternate Javascript client-side Form Validation via GET method' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1440'>PHP<\/a> , for example.<\/p>\n<p>By the way the format of the telephone number asked for by this tutorial is for an Australian telephone number which is a 2 or 3 digit area code followed by an 8 digit number.   If you can&#8217;t get through maybe you can just listen to a <a target=_blank title=\"Ring, Ring, Why don't you give me a call\" href='http:\/\/www.youtube.com\/watch?v=-aRBqoZN9rA'>song<\/a>.<\/p>\n<p><a target=_blank href='http:\/\/www.rjmprogramming.com.au\/Javascript\/FormValidation\/validate.html_GETME'>Download programming source code and rename to validate.html<\/a><\/p>\n<p>Regarding this  <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/Javascript\/FormValidation\/validate.html'>topic<\/a> I really like <em>&#8220;JavaScript &amp; Ajax&#8221; seventh edition by Tom Negrino and Dori Smith<\/em> <\/p>\n<p><strong><em>Did you know &#8230;<\/em><\/strong><br \/>\nJavaScript makes a great easy-access Calculator?<\/p>\n<p>Try typing the lines below into the address bar of your favourite browser:<\/p>\n<p>Javascript: eval(512 \/ 380);<br \/>\nJavascript: eval(512 * 380);<br \/>\nJavascript: eval(512 &#8211; 380);<br \/>\nJavascript: eval(512 + 380);<br \/>\nJavascript: eval(512 % 380);<\/p>\n<p>These days we spend so much time on the Internet it is a much quicker way to get to a calculator!\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d1431' onclick='var dv=document.getElementById(\"d1431\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d1431' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In tutorial here we use Javascript code to validate an HTML form element&#8217;s input tag data using regular expressions, as described by Wikipedia below: In computing, a regular expression (abbreviated regex or regexp) is a sequence of text characters, some &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/javascript-form-validation-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[453,652,997,1040,1319,1409],"class_list":["post-1431","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-form-validation","tag-javascript","tag-programming","tag-regex","tag-tutorial","tag-web-page"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/1431"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=1431"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/1431\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=1431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=1431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=1431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}