CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Other Programming Languages: Javascript:
No Refresh



Aug 4, 2001, 12:46 PM

Post #1 of 3 (46890 views)
No Refresh Can't Post

I am not sure if anyone can help with this. I have searched all of my usual resources. I have looked everywhere, but I cannot find what I need.

This would probably be useful to a lot of people!

Well when someone refreshes a page that is created by a cgi script...and the function to save info to a database is involved, the post will be sent to the database again.

My script also creates a page that shows all posts in a database. Therefore it creates a lot of multiple posts if someone refreshes the page.

I am looking for a JavaScript snippet that will not allow a page to be refreshed.

Not a whole lot of people would refresh the page...but just incase someone does. it would be nice to disable it. Thank you for your time =0)


use CGI;
$a = new pointless CGI();

(This post was edited by Etheracide on Aug 4, 2001, 11:47 AM)


Aug 4, 2001, 2:17 PM

Post #2 of 3 (46888 views)
Re: No Refresh [In reply to] Can't Post

I dont know about making it where they cant refresh but one way i have heard of is making it so they cant press the submit button several times and accidently make it submit more than once(usefull for forums mainly). I dont know where to get one but i saw it somewhere once.

@letters = ('A'..'Z', 'a'..'z', '1'..'5', '_');
@i = ( '15', '43', '40');
print @letters [ @i, -1, 55];


Nov 5, 2001, 12:56 AM

Post #3 of 3 (46861 views)
Re: No Refresh [In reply to] Can't Post

Disabling the submit button is done with a SubMitButtonObject.disabled = true line.

Yet an Other Perl Programmer

Find out more about programming


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives