Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Forcing output to a browser when perl is busy

by hbo (Monk)
on Jul 17, 2004 at 20:45 UTC ( #375286=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Forcing output to a browser when perl is busy
in thread Forcing output to a browser when perl is busy

<script language="Javascript1.1"> function justOneClick() { myform.clickme.disabled=true; // don't click me twice return true; // so the submit will go ahaed } </script> ... <form method="POST" name="myform" onSubmit="return justOneClick()"> ... <input type="submit" name ="clickme"> </form>


Comment on Re^3: Forcing output to a browser when perl is busy
Download Code
Re^4: Forcing output to a browser when perl is busy
by Anonymous Monk on Jul 17, 2004 at 22:40 UTC
    Ah ha, cool. That works. Of course, I had to mess with it and break it. I have two submit buttons, a Preview and a Post. As is, it disables the Post submit and I get an alert if the system is slower than the timeout. However, if I add a disable for the Preview button, my form variable gets eaten and it always posts. Since my script checks for Preview and otherwise posts the message, it works, but Preview is now broken. Here's what I did to the script:
    <script language="Javascript1.1"> function justOneClick() { message.Post.disabled=true; // don't click me twice message.Preview.disabled=true; // don't click me twice setTimeout('alert("Your form has been submitted. Please be patien +t, I\\'m working on it.")', 2000); return true; // so the submit will go ahaed } </script>

    I can live with only disabling post as it's the one that can take a while. Usually, the system is plenty fast for previewing. Apparently the name of the button gets eaten all together as my Post or your clickme doesn't exist in the form after the submit. Weird.

    Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://375286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-10-23 03:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls