473,788 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to detect submit abort / stop button?

4 New Member
Hi all,

While I understand there is no stop button handler, I do desire a way to know if a form submission was aborted.

When I submit my page, I lock down all of the controls so no further editing is allowed. If aborted (via ESC key, stop button, etc.) I'd like the page to open again.

Is this possible?

I thought that perhaps onAbort would be called if I displayed an animated GIF but that is not the case (and rightfully so; makes sense).

Any ideas? Thanks!
Jul 3 '07 #1
10 7178
sliffy
4 New Member
Also, I was thinking there would be a way to check something in Javascript with intervals...

setInterval('so meFunc()', 500);

function someFunc() {
/*
Check a property of window? document? form? navigator?
*/
}
Jul 3 '07 #2
kovik
1,044 Recognized Expert Top Contributor
If someone stops a form's submission, they have to deal with it, not you. You shouldn't worry about it.

If you're really concerned, don't disable the submission button.
Jul 3 '07 #3
sliffy
4 New Member
Hi V,

Much agreed.

The issue is that when the form submit is stopped, none of the data has been posted to the server and the entire form is locked down, so they have to refresh the page - losing all of their data. I have to lock down the form so that during a long submit operation, people don't edit the fields and get confused when the additional data disappears (this happens, trust me).

While you and I can easily agree (and we do) that pressing "stop" takes you out of the flow of our web apps, to users the data is still "there" in front of them - why can't I fix my mistake and press submit again?

While it pains me to say it, I'm prepared to use the document.stop handler in IE.

I spent 4 hours last night looking for a more portable solution. My only discovery was that Firefox sends the ESC key to the window so I can catch that.
Jul 3 '07 #4
gits
5,390 Recognized Expert Moderator Expert
hi ...

i think you may use ajax instead of a 'normal' form-submit. with the ajax-call you pass the data to the server and when you get the response you reenable your interface. so you have the control about the request. but i must admit that i don't know exactly whether the request may be stopped with ESC or the stop-button ... but if so you may get a response (request-status != 200) that is quite cool to handle ;) ...

kind regards
Jul 3 '07 #5
sliffy
4 New Member
Many thanks for the reply G :)

Because this form may contain a file upload (the lengthy operation which is typically aborted with the "stop" button), switching to an Ajax solution adds a lot of complexity.

I was hoping there would be and XHR-like property somewhere in window, navigator or document that I could check to see what the status of the request was.

Argh.
Jul 3 '07 #6
kovik
1,044 Recognized Expert Top Contributor
Basically, just don't disable the button. Sometimes, your server response is slow and if they abort and try again, it'll be faster (and most users know this). Disabling the button isn't generally a recommended practice, as it inhibits usability.
Jul 3 '07 #7
gits
5,390 Recognized Expert Moderator Expert
Basically, just don't disable the button. Sometimes, your server response is slow and if they abort and try again, it'll be faster (and most users know this). Disabling the button isn't generally a recommended practice, as it inhibits usability.
that depends strongly to the application ... and in case of using ajax-techniques it is evident to consider that option in cases where you send expensive requests (until the inerface is responsive during the request) ... exmp: send a request (may be to save something) ... in that case you disable the save-button until you get response (success or failure) ... the user notices that something happens, and you certainly dont want him to send that again ... during the first save-operation ... of course this creates 'quasi'-synchron-handling of async requests but when you have things that lasts 1 minute (and we have that here - due to processing mass-data in an intranet-application) you don't want the user to repeatedly send that request ... traffic, server-load, db-load ... etc.

so it improves usability - in such a case ...

but for traditional webapps you are right of course ...

kind regards
Jul 4 '07 #8
kovik
1,044 Recognized Expert Top Contributor
Actually, that would improve things on the server's end rather than the client's. As developers, we naturally care more about our servers and our bandwidth than the client does, so we're meant to protect it. However, in terms of usability, it's better to work in favor of the user rather than the server. For example, if the user was making a payment and hit the submit button twice, we'd want to detect to the extra click and submission and cancel the submission altogether rather than submit it twice.

The best thing you could do in terms of usability is make a very obvious "Processing " message displayed for the user so they are aware, but if they press the stop button, they can always retry.
Jul 4 '07 #9
gits
5,390 Recognized Expert Moderator Expert
;) i know what you mean ... but isn't it clientside usability too, when we are able to avoid double-payment through simple disabling of controls that the user shouldn't use at the moment? ... it is the same thing when we have chained menulists or something like that ... guiding the user with available actions/options.

assuming my mentioned example above: start a long, expensive request, start-it again ... they are handled parallel ... when using ajax ... every request handles the response ... may be altering something within the interface ... first request returns, or the second one ... is doing something with our ui ... later the next one returns ... probably the user worked with the ui after the first returning request ... and the second returning request handles the same things as the first one did ... and thus may be it resets the interface again to the state that the first one did. so avoiding 'double'-actions is in favour of the user ...

may be we should start a new thread on that? its getting besides the original problem ;))

kind regards
Jul 4 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4692
by: C. Olive | last post by:
Anyone know how to hook a browser's Stop button (event?) in JS? I've looked through the Document and Window DOM events in my O'Reilly JS book and don't see anything that stands out. About the closest thing I've come across is onAbort() in the Image object... I just want to know if Stop was clicked and if so redirect using parent.location... Thanks, Chris ----- Chris Olive
7
4680
by: Gayathri | last post by:
Is there anyway to disable the stop button in IE 6? Without doing "Opening in new window and toolbar is set to no" what will document.onstop help in?? I need to capture the browser stop event...is it possible?
0
1968
by: hy | last post by:
Hi all, I got the question about the radio button. How do i detect previous checked radio button after i checked other's radio button. While the new radio button checked, it need to prompt out a confirm message box, if user click on the 'cancel' button, system will programatically check the previous radio button instead of the latest radio button that checked.
4
1827
by: grant.griffith | last post by:
I need to find a way to force all the asp code on a web page to load regardless if the user hits the reload or stop button on the browser. I am seeing where more and more users are doing this and it is causing me some problems on some pages. I would guess there is a way to do this I am just searching for the wrong thing?
7
2276
by: jab3 | last post by:
Hello. I'm wondering if someone can answer something I'm sure has been answered a thousand times before. I am apparently just too dumb to find the answer. :) I've found information about the 'onstop' event, but it's not behaving as expected. (And it also seems to be a proprietary attribute) That is, my defined function is not being run when I click stop. I've 'inserted' it like this: <body onstop="stopped_clicked()"> And the function...
0
1080
by: Jay | last post by:
Hi, I have one situation where i have been stuck... its like i have two buttons on a page and what do i do is i click 1st button, which disables the 2nd button ( through Javascript ) and in code behind there is some code which runs and also takes some time ( means processing goes on ). In mean time if i click IE stop button the processing stops but also what i want is that 2nd button should get enabled on IE stop click.
0
1135
by: pallavi patel | last post by:
there is a form wh having 3 frames. in 1 frame there is heading info . in 2 frame there is Menu bar & in 3 frame there is submit button. if. i click on submit button. & i rellize that some wrong info. is get inserted. for that i am trying to click stop button in browser. it is not working means procedure for submit button get executed.
8
2051
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for button A's mouseup has completed? I beleive event processing to be single-threaded for good reason but I need a "stop" button and it's no good if it doesn't do anything until the other processing has finished :-)
1
1552
by: Brian Kejser | last post by:
Hi Using javascript, is it possible to detect if the user clicks the browser stop button? Thanks
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.