{"id":56196,"date":"2022-06-21T03:01:01","date_gmt":"2022-06-20T17:01:01","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=56196"},"modified":"2022-06-20T15:24:23","modified_gmt":"2022-06-20T05:24:23","slug":"window-object-method-override-textbox-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/window-object-method-override-textbox-tutorial\/","title":{"rendered":"Window Object Method Override Textbox Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Window Object Method Override Textbox Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override_textbox.jpg\" title=\"Window Object Method Override Textbox Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Window Object Method Override Textbox Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Window Object Method Override Primer Tutorial' href='#womopt'>Window Object Method Override Primer Tutorial<\/a>&#8216;s web application needed interactive entry to work.  There are many interactive entry methodologies available to web applications, but perhaps yesterday&#8217;s choice of &#8230;<\/p>\n<ul>\n<li>prompt Javascript popup window &#8230; approach is not ideal, it &#8220;doubling up&#8221; with the Window Object prompt method, only serving to add confusion, and so today, though we still offer a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html?popup=y\" title=\"prompt way\">prompt way<\/a>, the default way becomes &#8230;<\/li>\n<li>textbox<br \/>\n<code><br \/>\n&lt;input onblur=\"one=this.value;\" style=\"display:none;\" id=ione placeholder=\"one\" type=\"text\" value=\"\"&gt;&lt;\/input&gt;<br \/>\n&lt;input onblur=\"two=this.value;\" style=\"display:none;\" id=itwo placeholder=\"two\" type=\"text\" value=\"\"&gt;&lt;\/input&gt;<br \/>\n&lt;input onblur=\"three=this.value;\" style=\"display:none;\" id=ithree placeholder=\"three\" type=\"text\" value=\"\"&gt;&lt;\/input&gt;<br \/>\n&lt;input onblur=\"four=this.value;\" style=\"display:none;\" id=ifour placeholder=\"four\" type=\"text\" value=\"\"&gt;&lt;\/input&gt;<br \/>\n<br \/>\n&lt;select id=mysel onchange=\"<font color=blue>valnone();<\/font> setitup(this.value,'');\"&gt;<br \/>\n...<br \/>\n&lt;\/select&gt;<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; <font color=blue>supported by<\/font> Javascript code &#8230;<\/p>\n<p><code><br \/>\n  var one='', two='', three='', four='';<br \/>\n<br \/> <br \/>\n  function setitup(tv, newnewt) {<br \/>\n    var thisih='';<br \/>\n    var suff=';';<br \/>\n    var varsare=[], ivars;<br \/>\n    if (tv.indexOf('(') != -1 && tv.indexOf('()') == -1) {<br \/>\n      if (newnewt != '') {<br \/>\n      newt=newnewt;<br \/>\n      document.getElementById('myh4').style.backgroundColor='orange';<br \/>\n      } else {<br \/>\n      document.getElementById('myh4').style.backgroundColor='yellow';<br \/>\n      newt=template.replace(\/prompt\/g, tv.split('(')[0]).replace(\/one\\,two\/g, tv.split('(')[1].split(')')[0]);<br \/>\n      }<br \/>\n      vars=tv.split('(')[1].split(')')[0].split(',');<br \/>\n      for (ivars=0; ivars&lt;vars.length; ivars++) {<br \/>\n        <font color=blue>if (document.URL.indexOf('popup=') != -1) {<\/font><br \/>\n        thisih+=' ' + vars[ivars] + '=window.prompt(' + \"'Please enter value for \" + vars[ivars] + \"',''); \";<br \/>\n        <font color=blue>} else {<br \/>\n        document.getElementById('i' + vars[ivars]).style.display='block';<br \/>\n        if (newnewt == '') {<br \/>\n        document.getElementById('i' + vars[ivars]).value='';<br \/>\n        }<br \/>\n        thisih+=' document.getElementById(' + \"'i\" + vars[ivars] + \"'\" + ').value=' + \"'' + \" + vars[ivars] + ';   document.getElementById(' + \"'i\" + vars[ivars] + \"'\" + ').style.display=' + \"'block'\" + '; ';<br \/>\n        }<\/font><br \/>\n      }<br \/>\n      if (newt.indexOf(tv.split('(')[1].split(')')[0] + ')') != -1) {<br \/>\n      suff=newt.split(tv.split('(')[1].split(')')[0] + ')')[eval(-1 + newt.split(tv.split('(')[1].split(')')[0] + ')').length)].split('}')[0];<br \/>\n      }<br \/>\n      \/\/suff+=' valnone(); ';<br \/>\n      if (newt.indexOf('window.') != -1) {<br \/>\n      thisih+=' ' + newt.split('{')[1].split('window.')[0] + ' ' + tv.split('(')[0] + '(' + tv.split('(')[1].split(')')[0].trim() + ')' + suff + ' ';<br \/>\n      } else {<br \/>\n      thisih+=' ' + tv.split('(')[0] + '(' + tv.split('(')[1].split(')')[0].trim() + ')' + suff + ' ';<br \/>\n      }<br \/>\n      document.getElementById('myh4').innerHTML=\"&lt;a title='Double click to make happen' ondblclick=\\\"\" + thisih + \"\\\" style=text-decoration:underline;cursor:pointer;&gt;\" + newt + \"&lt;\/a&gt;\";<br \/>\n      eval(newt);<br \/>\n    }<br \/>\n  }<br \/>\n<br \/>\n  <font color=blue>function valnone() {<br \/>\n    document.getElementById('ione').style.display='none';<br \/>\n    document.getElementById('itwo').style.display='none';<br \/>\n    document.getElementById('ithree').style.display='none';<br \/>\n    document.getElementById('ifour').style.display='none';<br \/>\n  }<\/font><br \/>\n<\/code><\/p>\n<p> &#8230; in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html-GETME\" title=\"window_object_method_override.html\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html-GETME\" title=\"window_object_method_override.html\">window_object_method_override.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html\" title=\"Click picture\">&#8220;proof of concept&#8221; web application<\/a> you can also <a href='#ifwom'>try below<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/window-object-method-override-textbox-tutorial\/'>Window Object Method Override Textbox Tutorial<\/a>.<\/p-->\n<hr>\n<p id='womopt'>Previous relevant <a target=_blank title='Window Object Method Override Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/window-object-method-override-primer-tutorial\/'>Window Object Method Override 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\/window_object_method_override.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Window Object Method Override Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.jpg\" title=\"Window Object Method Override Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Window Object Method Override Primer Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a target=_blank title='Colour Wheel Prompt Override Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/colour-wheel-prompt-override-tutorial\/'>Colour Wheel Prompt Override Tutorial<\/a> <i>prompt<\/i><font size=1>ed<\/font> us <font size=1>(chortle, chortle)<\/font> to piece together a more generic look at &#8230;<\/p>\n<ul>\n<li><a target=_blank href='\/\/www.w3schools.com\/jsref\/obj_window.asp' title='https:\/\/www.w3schools.com\/jsref\/obj_window.asp'>window object methods<\/a> &#8230; and &#8230;<\/li>\n<li>override &#8230; ideas &#8230; merged into a &#8230;<\/li>\n<li>&#8220;proof of concept&#8221; web application<\/li>\n<\/ul>\n<p> &#8230; that might tweak some ideas and thoughts your way!  Try the Javascript DOM based <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html_GETME\" title=\"window_object_method_override.html\">window_object_method_override.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html\" title=\"Click picture\">&#8220;proof of concept&#8221; web application<\/a> you can also try below &#8230;<\/p>\n<p><iframe id=ifwom src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_object_method_override.html\" style=\"width:100%;height:350px;\"><\/iframe><\/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='#d56190' onclick='var dv=document.getElementById(\"d56190\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/window\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d56190' 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='#d56196' onclick='var dv=document.getElementById(\"d56196\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/method\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d56196' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s Window Object Method Override Primer Tutorial&#8216;s web application needed interactive entry to work. There are many interactive entry methodologies available to web applications, but perhaps yesterday&#8217;s choice of &#8230; prompt Javascript popup window &#8230; approach is not ideal, it &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/window-object-method-override-textbox-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,14,37],"tags":[1760,354,576,609,2780,652,1830,849,2010,875,1836,997,1761,1986,1675,1319,1583,3996,3997],"class_list":["post-56196","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-constant","tag-dom","tag-html","tag-input","tag-interactive-entry","tag-javascript","tag-method","tag-object","tag-object-oriented-programming","tag-oop","tag-override","tag-programming","tag-prompt","tag-proof-of-concept","tag-textbox","tag-tutorial","tag-window","tag-window-object","tag-window-object-method"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56196"}],"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=56196"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56196\/revisions"}],"predecessor-version":[{"id":56199,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56196\/revisions\/56199"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=56196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=56196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=56196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}