Re: Disabling button onclick in IE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2009-12-01 at 15:06 -0600, Skip Evans wrote:

> Hey all,
> 
> You probably remember me asking about disabling a submit 
> button when it is clicked to prevent double clicks submitting 
>   a form for CC processing.
> 
> I put the following code into the submit button and it works 
> fine on FireFox, but... hold your breath... not on IE.
> 
> The button gets disabled but the form just sits there, not 
> submitting. At first I just had
> 
> onclick="this.disabled=true;"
> 
> and that worked in FF also, but not in IE. Then I added the
> 
> document.ticket_form.submit();
> 
> But even that doesn't work with IE.
> 
> Below is the whole snippet for the button.
> 
> <input type="submit" name="submit" value="Purchase Ticket(s)" 
> id="submit_tickets" onclick="this.disabled=true; 
> document.ticket_form.submit();">
> 
> Any suggestions would be greatly appreciated.
> 
> Thanks,
> Skip
> 
> -- 
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
>   -- Kurt Vonnegut
> 
> 
> 
> 

wow, i really think you're going about this all the wrong way. in your
code, you should check to see if the exact same details have just been
passed from the same IP within a certain time-limit, say half a second.
Now this isn't foolproof, but it's a lot better than using javascript
(which isn't always available remember) solution.

interestingly, this server-side solution also gets around the problem
where information is sent via get. some browsers send it twice in
attempt to download and display the page more quickly (as get behaves
very differently from post data)

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux