generally I do something like here:

http://www.foorumbbs.com/static/js/utils.js

code:

$(document.forms).each( function(theform) {

        // disabled the Submit and Reset when submit a form
        // to avoid duplicate submit
        $(theform).submit( function() {
            $('input:submit').attr( { disabled : 'disabled' } );
            $('input:reset').attr(  { disabled : 'disabled' } );
        } );

        // Press Ctrl+Enter to submit the form. like QQ.
        $(theform).keypress( function(evt) {
            var x = evt.keyCode;
            var q = evt.ctrlKey;

            if (q && (x == 13 || x == 10)) {
                theform.submit();
            }
        } );
    } );


On Dec 23, 12:35 am, psy* <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I want to avoid double submitting, so I have the following code:
>
> $(function() {
>         $("input[type='submit']").click(function() {
>                 $("input[type='submit']").attr('disabled', true);
>         });
>
> });
>
> In FF, it works pretty nice, but in IE 6 and IE 7, the submit buttons
> gets disabled but the form is not submitted ... What's wrong with it? Do
> you have any better solution?
>
> Thanks!

Reply via email to