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>

Replies are listed 'Best First'.
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?
[choroba]: Munich is kind of close from here
[Corion]: marto: Maybe in three years it'll be Berlin again ;)
[marto]: in 3 years I may be able to go :P
[Corion]: choroba: Both teams will ponder on whether/where/how to organize things. The workshop will be mainly in German though
[Corion]: marto: Hehe ;)
[marto]: my out of working hours time is very scarce at the moment
[marto]: unfortunately for you guys I can still access PM during the day :P
[Corion]: marto: Ow, I hope that gets better soonish! But I feel some $work-timecrunch looming at my $work as well
[Corion]: marto: Ah, so you can multiplex work and PM time ;-D
[Corion]: The upside to this is that I've reduced my $work (well, $paid) time to 80%, so I'll be at $work only four days/week, which will hopefully make the crunch less crunchy on me ;)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-06-29 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.