{"id":54414,"date":"2021-12-29T03:01:03","date_gmt":"2021-12-28T17:01:03","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54414"},"modified":"2021-12-28T08:38:10","modified_gmt":"2021-12-27T22:38:10","slug":"autocompletion-combobox-navigate-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/autocompletion-combobox-navigate-tutorial\/","title":{"rendered":"AutoCompletion ComboBox Navigate Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"AutoCompletion ComboBox Navigate Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion_more.jpg\" title=\"AutoCompletion ComboBox Navigate Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">AutoCompletion ComboBox Navigate Tutorial<\/p><\/div>\n<p>Today&#8217;s task on top of the proof of concept work of yesterday&#8217;s <a title='AutoCompletion ComboBox Primer Tutorial' href='#accbpt'>AutoCompletion ComboBox Primer Tutorial<\/a> is to get some meaningful functionality when clicking that &#8220;Test&#8221; button (which up until today you would describe as &#8220;Validation only&#8221; functionality).  And so, today, should the user prime the web application with Wikipedia &#8220;List Of&#8221; data via that &#8220;.&#8221; link Javascript prompt access point, we turn that &#8220;Test&#8221; button into a &#8220;Navigate&#8221; button, whereby popup Wikipedia &#8220;List Of&#8221; windows can be opened via a PHP method=POST form navigation paradigm.<\/p>\n<p>Why navigate to the PHP helper?  Well, it is the same reason as why we navigate via a form method=POST paradigm in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.HTML-GETME\">wikiautocompletion.htm<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.html-GETME\">changed HTML parent<\/a> ]<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.htm\" title=\"Click picture\">live run<\/a>.  It is because large amounts of data are now needed to tag along with the navigation form, and so we add <font color=blue>new form fields<\/font> as per (in their static initial HTML guise) &#8230;<\/p>\n<p><code><br \/>\n&lt;form <font color=olive>id=myform<\/font> onsubmit=\"return true;\" method=\"GET\" action=\"wikiautocompletion.htm\"&gt;<br \/>\n&lt;table border=20&gt;<br \/>\n&lt;tr&gt;&lt;th&gt;Integer&lt;\/th&gt;&lt;th&gt;Lowercase&lt;\/th&gt;&lt;th&gt;Uppercase&lt;\/th&gt;&lt;\/tr&gt;<br \/>\n&lt;tr&gt;&lt;td&gt;&lt;\/td&gt;&lt;td&gt;&lt;\/td&gt;&lt;td&gt;&lt;\/td&gt;&lt;\/tr&gt;<br \/>\n&lt;\/table&gt;&lt;br&gt;<br \/>\n<font color=blue>&lt;input type=hidden id=\"inavigate\" value=''&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden id=\"itable\" value=''&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden id=\"icontent\" value=''&gt;&lt;\/input&gt;<\/font><br \/>\n&lt;input <font color=purple>id=isubmit<\/font> type=submit value=Test&gt;&lt;\/input&gt;<br \/>\n&lt;\/form&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; are initially set to not be populated nor &#8220;navigationally active&#8221; (where you need a <i>name<\/i> attribute created, the job for <font color=brown>ongoing Javascript code<\/font> work).  We also <font color=olive>give the HTML form an id<\/font><font size=1>entity<\/font> so that <font color=brown>ongoing Javascript code<\/font> work can change &#8220;validation only&#8221; <i>method=&#8221;GET&#8221; action=&#8221;wikiautocompletion.htm&#8221;<\/i> to &#8220;navigation via PHP&#8221; <i>method=&#8221;POST&#8221; action=&#8221;wikiautocompletion.php&#8221;<\/i> and give the HTML form&#8217;s <font color=purple>submit button<\/font> an id<\/font><font size=1>entity<\/font> in order to have <font color=brown>ongoing Javascript code<\/font> work change &#8220;validation only&#8221; &#8220;Test&#8221; value (ie. label) to &#8220;navigation via PHP&#8221; &#8220;Navigate&#8221; value &#8230;<\/p>\n<p><code><br \/>\n  function lookviapcontent() {<br \/>\n   if (document.getElementById('viapcontent').innerHTML == ''<font color=brown> && document.URL.indexOf('.php?') == -1<\/font>) {<br \/>\n    setTimeout(lookviapcontent, 1000);<br \/>\n   } else<font color=brown> if (document.URL.indexOf('.php?') == -1)<\/font> {<br \/>\n    divautoc=decodeURIComponent(document.getElementById('viapcontent').innerHTML);<br \/>\n    divarr=divautoc.split('`');<br \/>\n    divarr.sort();<br \/>\n    divarru=divautoc.toUpperCase().split('`');<br \/>\n    divarru.sort();<br \/>\n    divarrl=divautoc.toLowerCase().split('`');<br \/>\n    divarrl.sort();<br \/>\n    document.getElementById('viapcontent').innerHTML='';<br \/>\n    document.getElementById('viapcontent').innerHTML=divautoc.replace(\/\\`\/g,'<br \/>');<br \/>\n    document.getElementById('viapcontent').style.position='fixed';<br \/>\n    document.getElementById('viapcontent').style.left='40%';<br \/>\n    document.getElementById('viapcontent').style.top='100px';<br \/>\n    document.getElementById('viapcontent').style.display='block';<br \/>\n    <font color=brown><br \/>\n    if (document.getElementById('adot')) {<br \/>\n      if (document.getElementById('adot').innerHTML != '.') {<br \/>\n        if (document.getElementById('idot')) {<br \/>\n          document.getElementById('idot').value=document.getElementById('adot').innerHTML.substring(0,eval(-1 + document.getElementById('adot').innerHTML.length)).replace(' regarding List Of ','');<br \/>\n        } else {<br \/>\n          document.getElementById('myform').innerHTML+='&lt;input type=hidden name=idot id=idot value=\"' + document.getElementById('adot').innerHTML.substring(0,eval(-1 + document.getElementById('adot').innerHTML.length)).replace(' regarding List Of ','') + '\"&gt;&lt;\/input&gt;';<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n    if (document.URL.indexOf('.php') != -1) {<br \/>\n    document.getElementById('myform').method='POST';<br \/>\n    document.getElementById('myform').action=document.URL.split('?')[0].split('#')[0].replace('.html','.php').replace('.htm','.php');<br \/>\n    document.getElementById('itable').name='itable';<br \/>\n    document.getElementById('icontent').name='icontent';<br \/>\n    document.getElementById('icontent').value=divautoc;<br \/>\n    document.getElementById('itable').value=btoa(document.getElementsByTagName('table')[0].outerHTML);<br \/>\n    if (document.getElementById('inavigate')) {<br \/>\n    document.getElementById('inavigate').name='inavigate';<br \/>\n    }<br \/>\n    }<br \/>\n    if (document.getElementById('isubmit')) {<br \/>\n    document.getElementById('isubmit').value='Navigate';<br \/>\n    }<\/font><br \/>\n    setTimeout(mthen,5000);<br \/>\n   }<br \/>\n  }<br \/>\n<\/code><\/p>\n<p> &#8230; in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.js-GETME\">wikiautocompletion.js<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.js-GETME\">changed external Javascript<\/a>, while the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.php-GETME\">wikiautocompletion.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.php-GETME\">PHP helper changes<\/a> <font color=blue>as per<\/font> &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n $fg=\"\";<br \/>\n $tablebit=\"\";<br \/>\n $scriptbit=\"\";<br \/>\n if (file_exists(\"wikiautocompletion.htm\")) {<br \/>\n   $fg=file_get_contents(\"wikiautocompletion.htm\");<br \/>\n   $tbs=explode(\"&lt;\/table&gt;\", $fg);<br \/>\n   if (sizeof($tbs) &gt; 1) {<br \/>\n     $tablebit=\"&lt;table\" . explode(\"&lt;table\", $tbs[0])[1] . \"&lt;\/table&gt;\";<br \/>\n   }<br \/>\n   $sts=explode(\"&lt;\/style&gt;\", $fg);<br \/>\n   if (sizeof($sts) &gt; 1) {<br \/>\n     $scriptbit=explode(\"&lt;\/head&gt;\", $sts[1])[0];<br \/>\n   }<br \/>\n }<br \/>\n $newtablebit=explode(\"&lt;tr\", $tablebit)[0] . \"&lt;TR&gt;&lt;\/TR&gt;&lt;tr&gt;&lt;\/tr&gt;\" . \"&lt;\/table&gt;\";<br \/>\n<br \/> <br \/>\n <font color=blue>if ($fg != \"\" && isset($_POST['icontent']) && isset($_POST['itable'])) {<br \/>\n   $newfg=str_replace(' id=\"itable\" value=', ' id=\"itable\" name=\"itable\" value=',   str_replace(' id=\"icontent\" value=', ' id=\"icontent\" name=\"icontent\" value=',       str_replace(' method=\"GET\" action=\"wikiautocompletion.htm\"&gt;', ' method=\"POST\" action=\"wikiautocompletion.php\"&gt;', str_replace(' method=\"GET\" action=\"wikiautocompletion.html\"&gt;', ' method=\"POST\" action=\"wikiautocompletion.php\"&gt;', str_replace('.js?ddlist=','.js?ddJUNKlist=',str_replace('&lt;\/title&gt;',' &lt;\/title&gt;',$fg))))));<br \/>\n   $divbits=explode(\"&lt;\/div&gt;\", $fg);<br \/>\n   $newfg=str_replace(\"&lt;\/div&gt;\" . $divbits[-1 + sizeof($divbits)], str_replace('+',' ',urldecode($_POST['icontent'])) . \"&lt;\/div&gt;\" . $divbits[-1 + sizeof($divbits)], $newfg);<br \/>\n   $tblbits=explode(\"&lt;\/table&gt;\", $newfg);<br \/>\n   $oldtable=\"&lt;table \" . explode(\"&lt;table \",$tblbits[0])[1] . \"&lt;\/table&gt;\";<br \/>\n   $newfg=str_replace($oldtable, base64_decode($_POST['itable']), $newfg);<br \/>\n   if (isset($_POST['inavigate'])) {<br \/>\n   $tvalis='';<br \/>\n   $thewiki=str_replace('+','_',str_replace(' ','_',urldecode($_POST['inavigate'])));<br \/>\n   if (strpos($thewiki, '`') !== false) {<br \/>\n     $tvalis=\" setsval('\" . explode('`',$thewiki)[1] . \"','\" . explode('`',str_replace('+',' ',urldecode($_POST['inavigate'])))[0] . \"'); \";<br \/>\n     $thewiki=explode('`',$thewiki)[0];<br \/>\n   }<br \/>\n   if (isset($_POST['idot'])) {<br \/>\n   $newfg=str_replace('&gt;.&lt;', '&gt; regarding List Of ' . trim(str_replace('+',' ',urldecode($_POST['idot']))) . '.&lt;', str_replace('&lt;body', '&lt;body onload=\" var sw=eval(screen.width \/ 2); ' . $tvalis . ' window.open(' . \"'\" . '\/\/en.wikipedia.org\/wiki\/' . $thewiki . \"','_blank','top=180,left=' + sw + ',width=' + sw + ',height=500'); \" . '\"', $newfg));<br \/>\n   } else {<br \/>\n   $newfg=str_replace('&lt;body', '&lt;body onload=\" var sw=eval(screen.width \/ 2); ' . $tvalis . ' window.open(' . \"'\" . '\/\/en.wikipedia.org\/wiki\/' . $thewiki . \"','_blank','top=180,left=' + sw + ',width=' + sw + ',height=500'); \" . '\"', $newfg);<br \/>\n   }<br \/>\n   }<br \/>\n   echo $newfg;<br \/>\n   exit;<br \/>\n }<\/font><br \/>\n <\/code><br \/>\n?&gt;<\/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\/autocompletion-combobox-navigate-tutorial\/'>AutoCompletion ComboBox Navigate Tutorial<\/a>.<\/p-->\n<hr>\n<p id='accbpt'>Previous relevant <a target=_blank title='AutoCompletion ComboBox Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/autocompletion-combobox-primer-tutorial\/'>AutoCompletion ComboBox 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\/wikiautocompletion.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"AutoCompletion ComboBox Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.jpg\" title=\"AutoCompletion ComboBox Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">AutoCompletion ComboBox Primer Tutorial<\/p><\/div>\n<p>We have a desire to combine &#8230;<\/p>\n<ul>\n<li>&#8220;ComboBox&#8221; ideas of <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/combobox-sort-tutorial\/' title='ComboBox Sort Tutorial'>ComboBox Sort Tutorial<\/a> &#8230; with &#8230;<\/li>\n<li>AutoCompletion ideas for text entry, in today&#8217;s case, within an HTML div contenteditable=true<\/li>\n<\/ul>\n<p> &#8230; and we&#8217;re just at a &#8220;proof of concept&#8221; stage of our journey today with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.html_GETME\">wikiautocompletion.htm<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.html\" title=\"Click picture\">live run<\/a>&#8216;s use of  <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.js_GETME\">wikiautocompletion.js external Javascript<\/a> and <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wikiautocompletion.php_GETME\">wikiautocompletion.php PHP<\/a> helpers.<\/p>\n<p>That PHP code called in an iframe populates the web application&#8217;s data that allows for AutoCompletion ideas regarding <a target=_blank title='CSS information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Cascading_Style_Sheets'>Wikipedia<\/a> &#8220;List Of&#8221; URL data <font color=blue>accessible via<\/font> &#8230;<\/p>\n<p><code><br \/>\n&lt;h1&gt;Wikipedia Autocompletion Table&lt;a onclick=\"<font color=blue>var alist=prompt('Enter a comma separated list of Topics to tabulate links in dropdown elements for.  Left spaces makes this work with existing table above.',''); if (alist == null) { alist=''; } if (alist != '') { if (alist.trim() != alist) { var divs=document.getElementsByTagName('div'); var sels=document.getElementsByTagName('select'); for (var isels=0; isels&lt;sels.length; isels++) {  sels[isels].innerHTML='';  divs[isels].setAttribute('data-dropinnards', encodeURIComponent(divs[isels].innerHTML));  } document.getElementById('viapiframe').src='.\/wikiautocompletion.php?topics=' + encodeURIComponent(alist.trim()) + '&viap=' + Math.floor(Math.random() * 198765434);  } else { location.href='.\/wikiautocompletion.php?topics=' + encodeURIComponent(alist.trim()); }  }<\/font> \" style=\"text-decoration:none;cursor:pointer;\" title=\"Your own list\"&gt;.&lt;\/a&gt;&lt;\/h1&gt;<br \/>\n&lt;div id=viapcontent style=display:none;&gt;&lt;\/div&gt;<br \/>\n&lt;iframe id=viapiframe style=display:none; src=&gt;&lt;\/iframe&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; and then, to act if Wikipedia data is established &#8230;<\/p>\n<p><code><br \/>\n  var divautoc='';<br \/>\n  var divarr=[], divarrl=[], divarru=[];<br \/>\n<br \/>\n  function lookviapcontent() {<br \/>\n   if (document.getElementById('viapcontent').innerHTML == '') {<br \/>\n    setTimeout(lookviapcontent, 1000);<br \/>\n   } else {<br \/>\n    divautoc=decodeURIComponent(document.getElementById('viapcontent').innerHTML);<br \/>\n    divarr=divautoc.split('`');<br \/>\n    divarr.sort();<br \/>\n    divarru=divautoc.toUpperCase().split('`');<br \/>\n    divarru.sort();<br \/>\n    divarrl=divautoc.toLowerCase().split('`');<br \/>\n    divarrl.sort();<br \/>\n    document.getElementById('viapcontent').innerHTML='';<br \/>\n    document.getElementById('viapcontent').innerHTML=divautoc.replace(\/\\`\/g,'&lt;br&gt;');<br \/>\n    document.getElementById('viapcontent').style.position='fixed';<br \/>\n    document.getElementById('viapcontent').style.left='50%';<br \/>\n    document.getElementById('viapcontent').style.top='100px';<br \/>\n    document.getElementById('viapcontent').style.display='block';<br \/>\n    setTimeout(mthen,5000);<br \/>\n   }<br \/>\n  }<br \/>\n<br \/> <br \/>\n  function mthen() {<br \/>\n    document.getElementById('viapcontent').innerHTML='';<br \/>\n  }<br \/>\n<br \/> <br \/>\n  setTimeout(lookviapcontent, 1000);<br \/>\n<\/code><\/p>\n<p> &#8230; and onkeydown and onkeypress (keyboard event) instigated &#8220;AutoCompletion&#8221; feeling Javascript code logics to populate a column of HTML button elements <\/p>\n<p><code><br \/>\nfunction xautoc(ato) {<br \/>\n  var wasc=String.fromCharCode(eval(eval('' + ato.keyCode)));<br \/>\n  lastdivo=ato.target;<br \/>\n  lastdivid='' + ato.target.id;<br \/>\n  var atoih=ato.target.innerHTML;<br \/>\n<br \/> <br \/>\n  if (atoih.indexOf('&lt;\/select&gt;') != -1 && divarr.length &gt; 0) {<br \/>\n    if (atoih.split('&lt;\/select&gt;')[1].trim() == '' && lastdivo.innerHTML.indexOf('ion id=') != -1) {<br \/>\n      lastdivo.innerHTML=lastdivo.innerHTML.replace(\/\\ion id\\=\/g, 'ion data-id=');<br \/>\n      lastdivo.setAttribute('data-dropinnards', encodeURIComponent(lastdivo.innerHTML));<br \/>\n      atoih=ato.target.innerHTML;<br \/>\n    }<br \/>\n  } else if (atoih.trim() == '' && divarr.length &gt; 0 && lastdivo.innerHTML.indexOf('ion id=') != -1) {<br \/>\n    lastdivo.innerHTML=lastdivo.innerHTML.replace(\/\\ion id\\=\/g, 'ion data-id=');<br \/>\n    lastdivo.setAttribute('data-dropinnards', encodeURIComponent(lastdivo.innerHTML));<br \/>\n    atoih=ato.target.innerHTML;<br \/>\n  }<br \/>\n<br \/> <br \/>\n  if ((atoih + wasc) != '' && divarr.length &gt; 0) { \/\/document.getElementById('viapcontent').innerHTML != '') {<br \/>\n    var found=false, foundlist='';<br \/>\n    for (var ij=0; ij&lt;divarr.length; ij++) {<br \/>\n    if (atoih.indexOf('&lt;\/select&gt;') != -1) {<br \/>\n      if (!found && divarr[ij].toUpperCase().indexOf((atoih.split('&lt;\/select&gt;')[1] + wasc).toUpperCase()) == 0) {<br \/>\n        found=true;<br \/>\n        foundlist=divarr[ij];<br \/>\n      } else if (found && divarr[ij].toUpperCase().indexOf((atoih.split('&lt;\/select&gt;')[1] + wasc).toUpperCase()) != 0) {<br \/>\n        foundlist=foundlist;<br \/>\n      } else if (found) {<br \/>\n        foundlist+='`' + divarr[ij];<br \/>\n      }<br \/>\n    } else {<br \/>\n      if (!found && divarr[ij].toUpperCase().indexOf((atoih + wasc).toUpperCase()) == 0) {<br \/>\n        found=true;<br \/>\n        foundlist='&lt;button onclick=\"atwo(' + \"'\" + lastdivid + \"'\" + ',' + \"'\" + divarr[ij] + \"'\" + ');\"&gt;' + divarr[ij] + '&lt;\/button&gt;';<br \/>\n      } else if (found && divarr[ij].toUpperCase().indexOf((atoih + wasc).toUpperCase()) != 0) {<br \/>\n        foundlist=foundlist;<br \/>\n      } else if (found && foundlist.indexOf('&lt;button onclick=\"atwo(' + \"'\" + lastdivid + \"'\" + ',' + \"'\" + divarr[ij] + \"'\" + ');\"&gt;' + divarr[ij] + '&lt;\/button&gt;') == -1) {<br \/>\n        foundlist+='`' + '&lt;button onclick=\"atwo(' + \"'\" + lastdivid + \"'\" + ',' + \"'\" + divarr[ij] + \"'\" + ');\"&gt;' + divarr[ij] + '&lt;\/button&gt;';<br \/>\n      }<br \/>\n    }<br \/>\n    }<br \/>\n    if (atoih.indexOf('&lt;\/select&gt;') != -1) {<br \/>\n    \/\/document.title=(' ' + wasc + ' Foundlist (via ' + atoih.split('&lt;\/select&gt;')[1] + wasc + ')=' + foundlist);<br \/>\n    document.getElementById('viapcontent').innerHTML=foundlist.replace(\/\\`\/g,'&lt;br&gt;');<br \/>\n    } else {<br \/>\n    \/\/document.title=(' ' + wasc + ' Foundlist (via ' + atoih + wasc + ')=' + foundlist);<br \/>\n    document.getElementById('viapcontent').innerHTML=foundlist.replace(\/\\`\/g,'&lt;br&gt;');<br \/>\n    }<br \/>\n  }<br \/>\n<br \/> <br \/>\n  return atoih;<br \/>\n}<br \/>\n<br \/> <br \/>\nfunction atwo(wk, wkv) {<br \/>\n if (document.getElementById('lastopt')) {<br \/>\n document.getElementById('lastopt').innerHTML=wkv;<br \/>\n document.getElementById('lastopt').value=wkv;<br \/>\n document.getElementById(wk).innerHTML=document.getElementById(wk).innerHTML.replace(\/\\ id\\=\/g, ' data-id=');<br \/>\n document.getElementById('viapcontent').innerHTML='';<br \/>\n document.getElementById(wk).setAttribute('data-dropinnards', encodeURIComponent(document.getElementById(wk).innerHTML));<br \/>\n } else {<br \/>\n document.getElementById(wk).innerHTML=wkv;<br \/>\n \/\/document.getElementById(wk).setAttribute('data-sofar',wkv);<br \/>\n \/\/alert((\"\" + document.getElementById(wk).onblur).split('}')[0].split('{')[1].replace(\/event\\.target\/g,\"document.getElementById('\" + wk + \"')\"));<br \/>\n eval((\"\" + document.getElementById(wk).onblur).split('}')[0].split('{')[1].replace(\/event\\.target\/g,\"document.getElementById('\" + wk + \"')\"));<br \/>\n \/\/eval((\"\" + document.getElementById(wk).onblur).split('}')[0].split('{')[1].replace(\/event\\.target\/g,\"document.getElementById('\" + wk + \"')\"));<br \/>\n \/\/document.getElementById(wk).click();<br \/>\n \/\/document.getElementById('iootw').focus();<br \/>\n \/\/document.getElementById(wk).setAttribute('data-dropinnards', encodeURIComponent(document.getElementById(wk).innerHTML));<br \/>\n document.getElementById('viapcontent').innerHTML='';<br \/>\n }<br \/>\n}<br \/>\n<br \/> <br \/>\nfunction autoc(ato) {<br \/>\n  var wasc=String.fromCharCode(eval(eval('' + ato.keyCode)));<br \/>\n  lastdivo=ato.target;<br \/>\n  lastdivid='' + ato.target.id;<br \/>\n  var atoih=ato.target.innerHTML;<br \/>\n<br \/> <br \/>\n  if (atoih.indexOf('&lt;\/select&gt;') != -1 && divarr.length &gt; 0) {<br \/>\n    if (atoih.split('&lt;\/select&gt;')[1].trim() == '' && lastdivo.innerHTML.indexOf('ion id=') != -1) {<br \/>\n      lastdivo.innerHTML=lastdivo.innerHTML.replace(\/\\ion id\\=\/g, 'ion data-id=');<br \/>\n      \/\/lastdivo.setAttribute('data-dropinnards', encodeURIComponent(lastdivo.innerHTML));<br \/>\n      atoih=ato.target.innerHTML;<br \/>\n    }<br \/>\n  } else if (atoih.trim() == '' && divarr.length &gt; 0 && lastdivo.innerHTML.indexOf('ion id=') != -1) {<br \/>\n    lastdivo.innerHTML=lastdivo.innerHTML.replace(\/\\ion id\\=\/g, 'ion data-id=');<br \/>\n    \/\/lastdivo.setAttribute('data-dropinnards', encodeURIComponent(lastdivo.innerHTML));<br \/>\n    atoih=ato.target.innerHTML;<br \/>\n  }<br \/>\n<br \/> <br \/>\n  if ((atoih + wasc) != '' && divarr.length &gt; 0) { \/\/document.getElementById('viapcontent').innerHTML != '') {<br \/>\n    var found=false, foundlist='';<br \/>\n    for (var ij=0; ij&lt;divarr.length; ij++) {<br \/>\n    if (atoih.indexOf('&lt;\/select&gt;') != -1) {<br \/>\n      if (!found && divarr[ij].toUpperCase().indexOf((atoih.split('&lt;\/select&gt;')[1] + wasc).toUpperCase()) == 0) {<br \/>\n        found=true;<br \/>\n        foundlist=divarr[ij];<br \/>\n      } else if (found && divarr[ij].toUpperCase().indexOf((atoih.split('&lt;\/select&gt;')[1] + wasc).toUpperCase()) != 0) {<br \/>\n        foundlist=foundlist;<br \/>\n      } else if (found) {<br \/>\n        foundlist+='`' + divarr[ij];<br \/>\n      }<br \/>\n    } else {<br \/>\n      if (!found && divarr[ij].toUpperCase().indexOf((atoih + wasc).toUpperCase()) == 0) {<br \/>\n        found=true;<br \/>\n        \/\/foundlist='&lt;button onclick=\"document.getElementById(' + \"'\" + lastdivid + \"'\" + ').innerHTML=' + \"'\" + divarr[ij] + \"'\" + ';   document.getElementById(' + \"'\" + lastdivid + \"'\" + ').setAttribute(' + \"'data-sofar'\" + ',' + \"'\" + divarr[ij] + \"'\" + '.replace(\/\\\\ \/g,\"|\"));  eval((\"\" + document.getElementById(' + \"'\" + lastdivid + \"'\" + ').onblur).replace(\/event\\.target\/g,\\\"document.getElementById(' + \"'\" + lastdivid + \"'\" + ')\\\"));\"&gt;' + divarr[ij] + '&lt;\/button&gt;';<br \/>\n        foundlist='&lt;button onclick=\"atwo(' + \"'\" + lastdivid + \"'\" + ',' + \"'\" + divarr[ij] + \"'\" + ');\"&gt;' + divarr[ij] + '&lt;\/button&gt;';<br \/>\n      } else if (found && divarr[ij].toUpperCase().indexOf((atoih + wasc).toUpperCase()) != 0) {<br \/>\n        foundlist=foundlist;<br \/>\n      } else if (found && foundlist.indexOf('&lt;button onclick=\"atwo(' + \"'\" + lastdivid + \"'\" + ',' + \"'\" + divarr[ij] + \"'\" + ');\"&gt;' + divarr[ij] + '&lt;\/button&gt;') == -1) {<br \/>\n        foundlist+='`' + '&lt;button onclick=\"atwo(' + \"'\" + lastdivid + \"'\" + ',' + \"'\" + divarr[ij] + \"'\" + ');\"&gt;' + divarr[ij] + '&lt;\/button&gt;';<br \/>\n      }<br \/>\n    }<br \/>\n    }<br \/>\n    if (atoih.indexOf('&lt;\/select&gt;') != -1) {<br \/>\n    \/\/document.title+=(' ' + wasc + ' foundlist (via ' + atoih.split('&lt;\/select&gt;')[1] + ')=' + foundlist);<br \/>\n    document.getElementById('viapcontent').innerHTML=foundlist.replace(\/\\`\/g,'&lt;br&gt;');<br \/>\n    } else {<br \/>\n    \/\/document.title+=(' ' + wasc + ' foundlist (via ' + atoih + wasc + ')=' + foundlist);<br \/>\n    document.getElementById('viapcontent').innerHTML=foundlist.replace(\/\\`\/g,'&lt;br&gt;');<br \/>\n    }<br \/>\n  }<br \/>\n<br \/> <br \/>\n  return atoih;<br \/>\n}<br \/>\n<\/code><\/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='#d54409' onclick='var dv=document.getElementById(\"d54409\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/autocompletion\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54409' 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='#d54414' onclick='var dv=document.getElementById(\"d54414\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/form\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54414' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s task on top of the proof of concept work of yesterday&#8217;s AutoCompletion ComboBox Primer Tutorial is to get some meaningful functionality when clicking that &#8220;Test&#8221; button (which up until today you would describe as &#8220;Validation only&#8221; functionality). And so, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/autocompletion-combobox-navigate-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":[1695,174,2928,2442,342,354,367,409,452,576,652,710,1830,830,932,970,1866,1215,1675,1431],"class_list":["post-54414","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-autocompletion","tag-button","tag-combobox","tag-contenteditable","tag-div","tag-dom","tag-dropdown","tag-external-javascript","tag-form","tag-html","tag-javascript","tag-list","tag-method","tag-navigation","tag-php","tag-post","tag-select","tag-submit-button","tag-textbox","tag-wikipedia"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54414"}],"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=54414"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54414\/revisions"}],"predecessor-version":[{"id":54420,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54414\/revisions\/54420"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}