Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Double clicking a form submit, need to stop it.

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  Relative popularity of browsers.  
Author Message
rjames.clarke

External


Since: May 22, 2006
Posts: 18



(Msg. 1) Posted: Fri Nov 17, 2006 7:06 am
Post subject: Double clicking a form submit, need to stop it.
Archived from groups: alt>www>webmaster (more info?)

I have a double clicking user who is causing double entries in my
database.

It there a javascript routine that can disable the submit button for a
period of time, long enough to give the server a fighting chance?

many thanks in advance.
bobc

 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
rh

External


Since: Feb 05, 2007
Posts: 4



(Msg. 2) Posted: Fri Nov 17, 2006 1:03 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<rjames.clarke DeleteThis @gmail.com> wrote in message
news:1163775986.557051.9150@h54g2000cwb.googlegroups.com...
> I have a double clicking user who is causing double entries in my
> database.
>
> It there a javascript routine that can disable the submit button for a
> period of time, long enough to give the server a fighting chance?
>
> many thanks in advance.
> bobc
>

document.form.submitbutton.disabled=true;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>JS Submit Button Disable</title>
</head>
<script type="text/javascript">
function formsubmit(frm) {
frm.submitbutton.disabled=true;
alert("Form Submitted, Button disabled.");
return false;
}
</script>
<body>
<form action="" method="get" onsubmit="return formsubmit(this);">
Test: <input type="text"><br>
<input id="submitbutton" type="submit" value="Submit">
</form>
</body>
</html>


HTH

Rich

 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
rjames.clarke

External


Since: May 22, 2006
Posts: 18



(Msg. 3) Posted: Fri Nov 17, 2006 1:07 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks!
Works great.

rh wrote:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
> 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <title>JS Submit Button Disable</title>
>
> <script type="text/javascript">
> function formsubmit(frm) {
> frm.submitbutton.disabled=true;
> alert("Form Submitted, Button disabled.");
> return false;
> }
> </script>
> </head>
> <body>
> <form action="" method="get" onsubmit="return formsubmit(this);">
> Test: <input type="text"><br>
> <input id="submitbutton" type="submit" value="Submit">
> </form>
> </body>
> </html>
>
>
> fixed, sorry
>
> Rich
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
rh

External


Since: Feb 05, 2007
Posts: 4



(Msg. 4) Posted: Fri Nov 17, 2006 1:58 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>JS Submit Button Disable</title>

<script type="text/javascript">
function formsubmit(frm) {
frm.submitbutton.disabled=true;
alert("Form Submitted, Button disabled.");
return false;
}
</script>
</head>
<body>
<form action="" method="get" onsubmit="return formsubmit(this);">
Test: <input type="text"><br>
<input id="submitbutton" type="submit" value="Submit">
</form>
</body>
</html>


fixed, sorry

Rich
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
www

External


Since: Jun 29, 2003
Posts: 720



(Msg. 5) Posted: Fri Nov 17, 2006 4:12 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 17 Nov 2006 07:06:26 -0800, rjames.clarke.TakeThisOut@gmail.com wrote:

>I have a double clicking user who is causing double entries in my
>database.
>
>It there a javascript routine that can disable the submit button for a
>period of time, long enough to give the server a fighting chance?
>
>many thanks in advance.
>bobc
>

What I once did, was send the output through CGI to a Perl script
which displayed an intermediate page (a rough and dirty way is to use
"refresh"), and called the proper submit program with the supplied
parameters.

This stops people repeatedly hitting the submit button while the
server is trying to process the original request.

Matt

--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
rjames.clarke

External


Since: May 22, 2006
Posts: 18



(Msg. 6) Posted: Sat Nov 18, 2006 10:30 am
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Luckly this is an internal industrial application.
So I have control over that.
And you are right, he doesn't even know what javascript is.

Again, thanks all.


Dylan Parry wrote:
> rh wrote:
>
> > document.form.submitbutton.disabled=true;
>
> Bare in mind that this will only work in clients where scripting is
> available, although imho the type of person who double-clicks links and
> buttons is *very* unlikely to know what scripting is and won't have it
> turned off.
>
> --
> Dylan Parry
> http://electricfreedom.org | http://webpageworkshop.co.uk
>
> Programming, n: A pastime similar to banging one's head
> against a wall, but with fewer opportunities for reward.
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 7) Posted: Sat Nov 18, 2006 11:34 am
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

rh wrote:

> document.form.submitbutton.disabled=true;

Bare in mind that this will only work in clients where scripting is
available, although imho the type of person who double-clicks links and
buttons is *very* unlikely to know what scripting is and won't have it
turned off.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
rjames.clarke

External


Since: May 22, 2006
Posts: 18



(Msg. 8) Posted: Sun Nov 19, 2006 1:39 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

No actually he works for me.
Small company we hold many jobs, I do Quality, Operations, and I wrote
the enterprise system (php/mysql).
He is the production manager.

That would be rude.



On Nov 19, 4:13 pm, eponymous cowherd <n... DeleteThis @spam4me.com> wrote:
> In article <1163874605.872120.85... DeleteThis @h54g2000cwb.googlegroups.com>,
>
> rjames.cla... DeleteThis @gmail.com wrote:
> > Luckly this is an internal industrial application.
> > So I have control over that.
> > And you are right, he doesn't even know what javascript is.
>
> > Again, thanks all.Why can't you just kick him in the ass? Is this your boss?
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
eponymous cowherd

External


Since: Nov 19, 2006
Posts: 2



(Msg. 9) Posted: Sun Nov 19, 2006 9:13 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 10) Posted: Mon Nov 20, 2006 9:26 am
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

rjames.clarke.DeleteThis@gmail.com wrote:

> That would be rude.

Physically kicking someone might be, but telling someone that works for
you that double-clicking on buttons is screwing things up because the
Web doesn't work that way isn't - especially considering you are their
supervisor.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
www

External


Since: Jun 29, 2003
Posts: 720



(Msg. 11) Posted: Mon Nov 20, 2006 11:28 am
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 19 Nov 2006 13:39:12 -0800, rjames.clarke.DeleteThis@gmail.com wrote:

>> > Again, thanks all.Why can't you just kick him in the ass? Is this your boss?
>
>
>That would be rude.
>

But enormously satisfying!

<bg>

Matt


--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
Larry in Honolulu

External


Since: May 24, 2006
Posts: 2



(Msg. 12) Posted: Wed Nov 22, 2006 7:42 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1163797662.290619.313300.RemoveThis@e3g2000cwe.googlegroups.com>, rjames.clarke.RemoveThis@gmail.com wrote:
>Thanks!
>Works great.
>

OK, this is a bit late, but here's a simpler solution -

<form action="someProgram.cgi">
<input type="submit" id="btnSubmit" value="Submit"
onclick="this.disabled=true;this.value='Submitting...';
this.form.submit();">
</form>

Larry L
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
John Bokma

External


Since: Apr 27, 2005
Posts: 414



(Msg. 13) Posted: Wed Nov 22, 2006 8:05 pm
Post subject: Re: Double clicking a form submit, need to stop it. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

rjames.clarke RemoveThis @gmail.com wrote:

> I have a double clicking user who is causing double entries in my
> database.
>
> It there a javascript routine that can disable the submit button for a
> period of time, long enough to give the server a fighting chance?

Best thing to do is *not* relying on JS. Give the form a unique ID
(current time in s is not such a value) in a hidden field or use sessions.

--
John Need help with SEO? Get started with a SEO report of your site:

--> http://johnbokma.com/websitedesign/seo-expert-help.html
 >> Stay informed about: Double clicking a form submit, need to stop it. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
form field submit order - Hello, I have a form with stacks of fields. This is submitted to a formmail.asp script at my isp which emails the values in the form to me. Is there anyway using dreamweaver (or any editor) that I can define the order of the form fields when they are....

How do you transfer data from a form page to the page the .. - I have several forms that the user fills out 30 to 40 fields, I can store this information in a file on the server or/and send the information to an email address, this works fine. What I need is to get one of the data fields (their email address) from..

clicking on PPC as a job in India - are you getting trashed from India see http://timesofindia.indiatimes.com/articleshow/654822.cms

What is the referrer url for someone clicking on Google ad.. - Hi - just been looking at my webstats and I have 4 google referrel sites. They are: http://www.google.co.uk http://www.google.com http:// pagead2.googlesyndication.com http:// www.google.dealtime.co.uk Does anyone know for sure which is the referrer fo...

Opening application by clicking on link - I am trying to open an Excel spreadsheet from a link on a webpage so that users can enter data. So far, using just <a href="file:///x:/directory/filename.xls">Fileame</a> downloads the file to the users computer and then opens i...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]