{"id":461,"date":"2015-08-21T16:00:51","date_gmt":"2015-08-21T15:00:51","guid":{"rendered":"http:\/\/www.psinke.nl\/blog\/?p=461"},"modified":"2015-08-21T12:44:30","modified_gmt":"2015-08-21T11:44:30","slug":"prevent-your-webform-from-showing-the-are-you-sure-you-want-to-leave-this-page-message","status":"publish","type":"post","link":"https:\/\/www.psinke.nl\/blog\/prevent-your-webform-from-showing-the-are-you-sure-you-want-to-leave-this-page-message\/","title":{"rendered":"Prevent your webform from showing the &#8220;are you sure you want to leave this page&#8221; message"},"content":{"rendered":"<div class=\"afa2b3b851443650502c43e85c746c1f\" data-index=\"1\" style=\"float: none; margin:0px;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-4223201538046844\";\r\n\/* standaardblok *\/\r\ngoogle_ad_slot = \"9522527129\";\r\ngoogle_ad_width = 320;\r\ngoogle_ad_height = 50;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>When\u00a0a webpage in your application detects changes made to input items (if they are valid or not), it will present the user a popup asking if he\/she wants to leave the page or stay on the page. Although that is useful in many cases, sometimes you just want to switch it off on \u00a0a specific page. The solution is really easy.<\/p>\n<p>Place the following Javascript in the onLoad event of your page:<\/p>\n<pre>window.onbeforeunload = null;<\/pre>\n<p>In for instance, Application Express, you can put it in the <b>Execute when page loads<\/b>\u00a0item in the Javascript section of your page.<\/p>\n<p>If you want to show a different message, just replace the null with the message between double quotes.<\/p>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>When\u00a0a webpage in your application detects changes made to input items (if they are valid or not), it will present the user a popup asking if he\/she wants to leave the page or stay on the page. Although that is useful in many cases, sometimes you just want to switch it off on \u00a0a specific&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141,192],"tags":[130,142,371,372,11,49],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-apexapplication-express","category-web-software-development","tag-apex","tag-javascript","tag-onload","tag-page-unload","tag-programming","tag-webdesign"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":1,"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":462,"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions\/462"}],"wp:attachment":[{"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.psinke.nl\/blog\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}