{"id":45708,"date":"2019-07-25T03:01:08","date_gmt":"2019-07-24T17:01:08","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=45708"},"modified":"2019-07-24T17:38:33","modified_gmt":"2019-07-24T07:38:33","slug":"html5-form-api-validation-revisit-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-form-api-validation-revisit-tutorial\/","title":{"rendered":"HTML5 Form API Validation Revisit Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML5 Form API Validation Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/makeover_constraint.jpg\" title=\"HTML5 Form API Validation Revisit Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML5 Form API Validation Revisit Tutorial<\/p><\/div>\n<p>You&#8217;d think after a long time in the programming world thinking the command line was so good, I&#8217;d have stopped relying on imagery to be interested in information.   But, there you go, truth be told, it&#8217;s either me or the influence of &#8220;the net&#8221; that has made me need images not to move on, am pretty sure.  And so, revisiting <a title='HTML5 Form API Validation Primer Tutorial' href='#html5fapivpt'>HTML5 Form API Validation Primer Tutorial<\/a>, albeit that it represents a &#8220;proof of concept&#8221; scenario, it &#8220;hurt me&#8221; not to see any imagery within the webpage itself.  Country codes and currency codes, even given the brilliant organizational skills of <a target=_blank title='ISO information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/International_Organization_for_Standardization'>International Organization for Standardization<\/a> (<font size=1>good &#8216;ol<\/font> ISO), is a pretty dry subject in our books (<font size=1>down, pamphlettes, down<\/font>).<\/p>\n<p>But who\/what to turn to to add some interesting anything?  That last link had a clue?  You <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=uhiCFdWeQfA'>want another<\/a>?  Yes, <a target=_blank title='Tiberius information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Tiberius'>Tiberius Caesar Divi Augusti filius Augustus<\/a>, it&#8217;s <a target=_blank title='Wikipedia' href='\/\/wikipedia.org'>Wikipedia<\/a>.  But <a target=_blank title='Tiberius information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Tiberius'>Tiberius Caesar Divi Augusti filius Augustus<\/a> did you know we also involve <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Charts<\/a> <a target=_blank title='Google Chart Map Chart' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/map'>Map Chart<\/a> and <a target=_blank title='Google Chart Map Chart' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/geochart'>Geo Chart<\/a>?  No?  Well, perhaps <a target=_blank title='Vipsania Agrippina information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Vipsania_Agrippina'>Vipsania Agrippina<\/a>, your blank stare says it all.  Yes, <a target=_blank title='Tiberius information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Tiberius'>Tiberius Caesar Divi Augusti filius Augustus<\/a> caeser the moment (tee hee) &#8230; you are excused.<\/p>\n<p>You can see in code how we achieved this with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html-GETME\" title=\"\/HTMLCSS\/html5_form_constraint_validation.html\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html-GETME\" title=\"\/HTMLCSS\/html5_form_constraint_validation.html\">html5_form_constraint_validation.html<\/a> and its <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html\" title=\"\/HTMLCSS\/html5_form_constraint_validation.html\">live run<\/a> link.<\/p>\n<hr>\n<p id='html5fapivpt'>Previous relevant <a target=_blank title='HTML5 Form API Validation Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html5-form-api-validation-primer-tutorial\/'>HTML5 Form API Validation Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML5 Form API Validation Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.jpg\" title=\"HTML5 Form API Validation Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML5 Form API Validation Primer Tutorial<\/p><\/div>\n<p>HTML5 is more than just the &#8220;5&#8221; tagged on.  Take a look at <a target=_blank title='List of HTML5 APIs' href='https:\/\/www.htmlgoodies.com\/html5\/javascript\/a-5-minute-overview-of-all-new-javascript-apis-in-html5.html'>this list<\/a> of API related parts to the HTML5 specification.<\/p>\n<p>As you may have gleaned from our recent <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html-input-element-types-randomized-history-tutorial\/' title='HTML Input Element Types Randomized History Tutorial'>HTML Input Element Types Randomized History Tutorial<\/a> a lot of new HTML input elements were added with the view to improving the capabilities of HTML form elements for collecting information from users interactively.   Along with that, as you might expect, validation methodologies were improved, as any programmer would tell you, can be one of the most challenging &#8220;practical element&#8221; of web design to do well to not involve user error, or &#8220;user giving up&#8221;.<\/p>\n<p>The HTML5 form API has great &#8220;Constraint Validation&#8221;, not all new to HTML, but vastly improved and extended, as you can read a lot about at this <a target=_blank href='https:\/\/www.html5rocks.com\/en\/tutorials\/forms\/constraintvalidation\/' title='Constraint Validation in HTML5 Form API'>really great webpage<\/a>, thanks.<\/p>\n<p>The HTML input attribute we find of great practical benefit with all this is the <a target=_blank title='HTML input element pattern attribute information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_input_pattern.asp'><i>pattern<\/i><\/a> attribute to define a constraint, in the same sort of vein as a <a target=_blank title='Javascript regex' href='http:\/\/www.w3schools.com\/jsref\/jsref_obj_regexp.asp'>RegEx<\/a> expressions helps you perform pattern-matching and &#8220;search and replace&#8221; functions on text.  This would be great use for organizations that work with &#8220;codes&#8221; or &#8220;Part Numbers&#8221; or SKU (<a target=_blank title='SKU information' href='http:\/\/www.investopedia.com\/terms\/s\/stock-keeping-unit-sku.asp'>stock keeping units<\/a>) that follow a consistent <i>pattern<\/i>.<\/p>\n<p>You can try some simple Constraint Validation at today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html\" title=\"Click picture\">live run<\/a> link with its underlying serverside PHP code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/html5_form_constraint_validation.html_GETME\" title=\"\/HTMLCSS\/html5_form_constraint_validation.html\">html5_form_constraint_validation.html<\/a> as you wish.<\/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='#d33831' onclick='var dv=document.getElementById(\"d33831\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/validation\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d33831' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d45708' onclick='var dv=document.getElementById(\"d45708\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/wikipedia\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d45708' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You&#8217;d think after a long time in the programming world thinking the command line was so good, I&#8217;d have stopped relying on imagery to be interested in information. But, there you go, truth be told, it&#8217;s either me or the &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-form-api-validation-revisit-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[400,452,1619,513,519,576,578,652,745,2126,997,1319,1358,1431],"class_list":["post-45708","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-event","tag-form","tag-geo-chart","tag-google","tag-google-charts","tag-html","tag-html5","tag-javascript","tag-map","tag-map-chart","tag-programming","tag-tutorial","tag-validation","tag-wikipedia"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/45708"}],"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=45708"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/45708\/revisions"}],"predecessor-version":[{"id":45712,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/45708\/revisions\/45712"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=45708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=45708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=45708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}