Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by hbo (Monk)
on Jul 17, 2004 at 20:45 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://375286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-26 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found