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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Other Programming Languages: Javascript:
No Refresh

 



etheracide
journeyman

Aug 4, 2001, 12:46 PM

Post #1 of 3 (26261 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)

#!/usr/dusnt/know/perl

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

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


Pro_4
User

Aug 4, 2001, 2:17 PM

Post #2 of 3 (26259 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];


yapp
User

Nov 5, 2001, 12:56 AM

Post #3 of 3 (26232 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
http://www.cool-programming.f2s.com

 
 


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

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