CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Emulate disable browser back button Javascript

Print topic Send  topic

Author Message
MichaelMcDonald

Posts: 640
Posted: 06/10/2014, 7:18 PM

And here's a little JS that emulates disabling the browsers back button by re-forcing forward to the last page .. it's cool because it forces users to use links or buttons....

<script type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</script>

<body onpageshow="if (event.persisted) noBack();">
_________________
Central Coast, NSW, Australia.

View profile  Send private message
terrystrickl

Posts: 2
Posted: 04/04/2015, 9:37 AM

This is a seamless no refresh/submit/reload contact form that uses AJAX to validate your email, grab the variables, put them into URL parameters and POST them to your .php file to get them and runs the sendmail script in the background.

_________________

View profile  Send private message
eratech


Posts: 513
Posted: 04/04/2015, 9:08 PM

Quote terrystrickl:
This is a seamless no refresh/submit/reload contact form that uses AJAX to validate your email, grab the variables, put them into URL parameters and POST them to your .php file to get them and runs the sendmail script in the background.


We are getting recursive when comments are quoting sections back to the original commenter with zero context (see MichaelMcDonald's comment 11 July 2014 "Javascript / PHP Mail Contact Form without form submit"
http://forums.yessoftware.com/posts.php?post_id=123299 )

Sigh.

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
andrewi

Posts: 162
Posted: 04/07/2015, 3:34 PM

It's a spambot, unfortunately.

Thanks for posting the tip (belatedly). I wondered how that might be done.
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 06/17/2015, 3:48 AM

The jquery version, works better:

<script>

$(document).ready(function() {
function disableBack() { window.history.forward() }

window.onload = disableBack();
window.onpageshow = function(evt) { if (evt.persisted) disableBack() }
});

</script>
_________________
Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.