473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re-enabling a disabled submit button if browser times out

Hi all,

I've googled this one to death, and still can't find an answer. Not
sure I'm asking the right question, but here goes:

Have a form with an onSubmit that has some javscript to disable the
submit button. When the user clicks submit, the value of the button
changes to "Processing..." and the button disables.

The cgi to which it is submitting will process the data and render the
next page.

During that process suppose that there is a problem of some sort on the
server and the browser times out.

Is there any way at all of detecting that in javascript and re-enabling
the submit button?

I read in an earlier post that once Submit is clicked the context is
torn down and all bets are off. Just wanted to verify that is the case.

Thanks!
Frank
Jul 23 '05 #1
4 1989
"Frank Way" <fg*******@yahoo.com> wrote in message
news:Y9CKd.98693$Wo.14854@lakeread08...
Hi all,

I've googled this one to death, and still can't find an answer. Not
sure I'm asking the right question, but here goes:

Have a form with an onSubmit that has some javscript to disable the
submit button. When the user clicks submit, the value of the button
changes to "Processing..." and the button disables.

The cgi to which it is submitting will process the data and render the
next page.

During that process suppose that there is a problem of some sort on the
server and the browser times out.

Is there any way at all of detecting that in javascript and re-enabling
the submit button?
I don't think so.
I read in an earlier post that once Submit is clicked the context is
torn down and all bets are off. Just wanted to verify that is the case.

Thanks!
Frank


Do you have something like this?

<html>
<head>
<title>Submits.htm</title>
<script type="text/javascript">
function Submits(form) {
form.Submit.value = "Processing...";
form.Submit.disabled = true;
if (!confirm("Submit?")) return false; // for testing
return true;
}
</script>
</head>
<body>
<form action="Submits.cgi" method="get" onSubmit="return Submits(this)">
<input type="text" name="ID" size="1" value="1">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>

Your cgi script should handle the problems.
Jul 23 '05 #2
McKirahan wrote:
"Frank Way" <fg*******@yahoo.com> wrote in message
news:Y9CKd.98693$Wo.14854@lakeread08...
Hi all,

I've googled this one to death, and still can't find an answer. Not
sure I'm asking the right question, but here goes:

Have a form with an onSubmit that has some javscript to disable the
submit button. When the user clicks submit, the value of the button
changes to "Processing..." and the button disables.

The cgi to which it is submitting will process the data and render the
next page.

During that process suppose that there is a problem of some sort on the
server and the browser times out.

Is there any way at all of detecting that in javascript and re-enabling
the submit button?

I don't think so.

I read in an earlier post that once Submit is clicked the context is
torn down and all bets are off. Just wanted to verify that is the case.

Thanks!
Frank

Do you have something like this?

<html>
<head>
<title>Submits.htm</title>
<script type="text/javascript">
function Submits(form) {
form.Submit.value = "Processing...";
form.Submit.disabled = true;
if (!confirm("Submit?")) return false; // for testing
return true;
}
</script>
</head>
<body>
<form action="Submits.cgi" method="get" onSubmit="return Submits(this)">
<input type="text" name="ID" size="1" value="1">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>

Your cgi script should handle the problems.


Yes, that is basically what I have.

Thanks for the advice -- I'll try attacking this one from server-side
then....

fw
Jul 23 '05 #3
Frank,

May be I misunderstood your post, but wouldn't you get something like a
"page not found" error when the server/cgi is timed out? Basically,
the browser did not get a response from the server. You wouldn't see
the orginal form anyway.

However, if you're talking about stopping the submission (like clicking
on the "stop" browser button) ... you can try using a timer
(setTimeout) to trigger the code to enable the button, say after 1
minute or 2.

just an idea ...

Jul 23 '05 #4
sunami wrote:
Frank,

May be I misunderstood your post, but wouldn't you get something like a
"page not found" error when the server/cgi is timed out? Basically,
the browser did not get a response from the server. You wouldn't see
the orginal form anyway.

However, if you're talking about stopping the submission (like clicking
on the "stop" browser button) ... you can try using a timer
(setTimeout) to trigger the code to enable the button, say after 1
minute or 2.

just an idea ...


I'll be a bit more specific.... I really can't post any code because of
confidentiality requirements, but the specific situation involves
fail-over of redundant web servers.

The user has filled out a form on a page. They hit the submit button,
it disables, and displays the word "Processing..." Their request is
going to the server involved in the failover, and the browser actually
times out. (Haven't had my coffee yet this morning and forget the
actually message that pops up). They click "Ok" in the alert box (or
confirm box,not sure which), and are basically stuck there.

I wanted a graceful way of backing them out of that -- if possible.

I will investigate the timeout idea...that might be useful.

Thanks!
fw
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would...
4
by: Craig Bailey | last post by:
Anyone recommend a good script editor for Mac OS X? Just finished a 4-day PHP class in front of a Windows machine, and liked the editor we used. Don't recall the name, but it gave line numbers as...
1
by: Chris | last post by:
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm going wrong? Thanks in advance and sorry again...
4
by: Alan Walkington | last post by:
Folks: How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function...
1
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with...
10
by: James | last post by:
What is the best method for creating a Web Page that uses both PHP and HTML ? <HTML> BLA BLA BLA BLA BLA
8
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an...
8
by: Lothar Scholz | last post by:
Because PHP5 does not include the mysql extension any more is there a chance that we will see more Providers offering webspace with Firebird or Postgres Databases ? What is your opinion ? I must...
1
by: joost | last post by:
Hello, I'm kind of new to mySQL but more used to Sybase/PHP What is illegal about this query or can i not use combined query's in mySQL? DELETE FROM manufacturers WHERE manufacturers_id ...
1
by: Brian | last post by:
I have an array like this: $events = array( array( '2003-07-01', 'Event Title 1', '1' //ID Number (not unique) ), array( '2003-07-02',
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.