{"id":64092,"date":"2024-07-03T03:01:31","date_gmt":"2024-07-02T17:01:31","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=64092"},"modified":"2024-07-03T14:44:05","modified_gmt":"2024-07-03T04:44:05","slug":"form-target-self-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/form-target-self-primer-tutorial\/","title":{"rendered":"Form Target Self Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_self_use.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Form Target Self Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/window_self_use.jpg\" title=\"Form Target Self Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Form Target Self Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve rarely used the &#8230;<\/p>\n<ul>\n<li>form<\/li>\n<li>method=POST<\/li>\n<li>action=[URLofInterestOfPHP]<\/li>\n<li>target=_self <font size=1>(<a target=_blank title='HTML form target attribute information from W3schools' href='https:\/\/www.w3schools.com\/tags\/att_form_target.asp#:~:text=Definition%20and%20Usage,window%2C%20or%20inline%20frame).'>versus any &#8220;_blank&#8221; (we&#8217;d have used most often in the past) or &#8220;_parent&#8221; or &#8220;_top&#8221; or &#8220;framename&#8221; (of iframe) alternative target value ideas<\/a>)<\/font><\/li>\n<\/ul>\n<p> &#8230; style of arrangement in the past, but we&#8217;ve found it useful recently (a couple of times) because we find we want to, more and more, use &#8230;<\/p>\n<ul>\n<li>hashtagged data<\/li>\n<li>reassembled into a &#8230;\n<ol>\n<li>form<\/li>\n<li>method=POST<\/li>\n<li>action=[URLofInterestOfPHP]<\/li>\n<li>target=_self<\/li>\n<\/ol>\n<p> &#8230; arrangement &#8230;\n<\/li>\n<\/ul>\n<p> &#8230; that way keeping any window.parent and window.self and\/or window.opener and window.self connections intact, and at the same time, being able to involve very long (mostly hashtagged data) URLs in the arrangements.<\/p>\n<p>Let&#8217;s show you an example.  In the recently talked about <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 Charts Image Chart' href='https:\/\/developers.google.com\/chart\/image\/docs\/gallery\/chart_gall'>Image Chart<\/a> Map Chart <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\">inhouse interfacer<\/a> called image_chart.php downaways into the code <font color=blue>it now goes<\/font> &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$screenheight='0';<br \/>\n&lt;br&gt;<br \/>\n\/\/ ;Continent;CC1|CC2|:blLAT,blLONG,trLAT,trLONG:width,height:scblX,scblY,sctrX,sctrY<br \/>\n$continfo=';Europe;IS|CY|:35.16666,-27.6,67.0,33.36666:468,450:422,560,890,140';  \/\/ 53 523<br \/>\n$continfo.=';Australia;AU|AU|:-44,113.65,-10.26667,161.28333:600,450:422,560,866,140';<br \/>\n$continfo.=';Asia;FI|WS|:-14,37,81,179.9:600,450:422,560,866,140';<br \/>\n$continfo.=';America;GS|US|:-56,-179.9,77,-35:600,450:422,560,866,140';<br \/>\n$continfo.=';Africa;TF||:-35,-17,37,52:600,450:422,560,890,140';<br \/>\nif (isset($_GET['screenheight'])) {<br \/>\n    $screenheight=str_replace('+',' ',urldecode($_GET['screenheight']));<br \/>\n}<br \/>\nif (isset($_POST['screenheight'])) {<br \/>\n    $screenheight=str_replace('+',' ',urldecode($_POST['screenheight']));<br \/>\n}<br \/>\n&lt;br&gt;<br \/>\nif (isset($_GET['nothing'])) {<br \/>\n  exit;<br \/>\n<font color=blue>} else if ($screenheight != '0' && !isset($_GET['returnxytoparent']) && (!isset($_POST['returnxytoparent']) && !isset($_POST['ix']))) {<br \/>\n  echo \"&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;script type=text\/javascript&gt;<br \/>\n  function tryit() {<br \/>\n    if (('' + location.hash).indexOf('returnxytoparent=') != -1) {<br \/>\n      document.getElementById('returnxytoparent').value=decodeURIComponent(('' + location.hash).split('returnxytoparent=')[1].split('&')[0].split('#'));<br \/>\n      document.getElementById('submy').click();<br \/>\n    }<br \/>\n  }<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body onload=tryit();&gt;<br \/>\n&lt;form style=display:none; <i>target=_self<\/i> action=\/PHP\/GeoChart\/image_chart.php method=POST&gt;<br \/>\n&lt;input type=hidden name=returnxytoparent id=returnxytoparent value=\\\"\\\"&gt;&lt;\/input&gt;<br \/>\n&lt;input type=hidden name=screenheight value=\" . $screenheight . \"&gt;&lt;\/input&gt;<br \/>\n&lt;input type=submit style=display:none; value=Submit id=submy&gt;&lt;\/input&gt;<br \/>\n&lt;\/form&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;\";<br \/>\n  exit;<\/font><br \/>\n} else if (isset($_GET['returnxytoparent']) || (isset($_POST['returnxytoparent']) && !isset($_POST['ix']))) {<br \/>\n\/\/ more code to do with real returnxytoparent data follows<br \/>\n}<br \/>\n\/\/ more code follows<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; called from our inhouse <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/regions_via_countries.html\">Region Picker<\/a> <font color=blue>in this way now<\/font> <font size=1>(where inhouse Javascript function windowdotdotopen can be thought of as window.open for these purposes)<\/font> &#8230;<\/p>\n<p><code><br \/>\n  <font color=blue>if (eval('' + encodeURIComponent(theurlis).length) > 750) {<br \/>\n  dbwo=windowdotdotopen('\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php' + '?screenheight=' + screen.height + '#returnxytoparent=' + encodeURIComponent(theurlis),'_blank','top=' + eval(-300 + screen.height) + ',left=450,width=600,height=300');<br \/>\n  } else {<\/font><br \/>\n  dbwo=windowdotdotopen('\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php?returnxytoparent=' + encodeURIComponent(theurlis) + '&screenheight=' + screen.height,'_blank','top=' + eval(-300 + screen.height) + ',left=450,width=600,height=300');<br \/>\n  <font color=blue>}<\/font><br \/>\n<\/code><\/p>\n<p> &#8230; setting up a two way understanding between window.opener Region Picker and window.self Google Charts Image Chart Map Chart inhouse interfacer.  Using that <font color=blue><i>target=_self<\/i><\/font> arrangement above allows &#8230;<\/p>\n<ul>\n<li>despite the <a target=_blank title=? href='https:\/\/www.youtube.com\/watch?v=KLOyChP2AWA'>&#8220;double dipping&#8221;<\/a> transfer of hashtagged URL data (when longer than 750 characters, <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=PtR4cWb4HNg'>that is<\/a>) into method=POST form data (of considerable size) &#8230;<\/li>\n<li>that <i>understanding between window.open Region Picker and window.self Google Charts Image Chart Map Chart inhouse interfacer<\/i> remains intact<\/li>\n<\/ul>\n<p>Yayyyyyy!<\/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='#d64092' onclick='var dv=document.getElementById(\"d64092\"); 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='d64092' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve rarely used the &#8230; form method=POST action=[URLofInterestOfPHP] target=_self (versus any &#8220;_blank&#8221; (we&#8217;d have used most often in the past) or &#8220;_parent&#8221; or &#8220;_top&#8221; or &#8220;framename&#8221; (of iframe) alternative target value ideas) &#8230; style of arrangement in the past, but &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/form-target-self-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,14,37],"tags":[3028,2525,290,4818,452,1533,557,3961,576,4817,1830,830,2411,932,970,997,4610,3565,1319,1345,1418,3010,4820,4819],"class_list":["post-64092","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-action","tag-child","tag-data","tag-double-dip","tag-form","tag-get","tag-hashtag","tag-hashtagging","tag-html","tag-long-data","tag-method","tag-navigation","tag-parent","tag-php","tag-post","tag-programming","tag-self","tag-target","tag-tutorial","tag-url","tag-webpage","tag-window-opener","tag-window-parent","tag-window-self"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64092"}],"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=64092"}],"version-history":[{"count":10,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64092\/revisions"}],"predecessor-version":[{"id":64104,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64092\/revisions\/64104"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=64092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=64092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=64092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}