Subversion Repositories DevTools

Rev

Rev 7291 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7291 Rev 7293
Line 628... Line 628...
628
//  Auto enable/disable a submit button in a simple form
628
//  Auto enable/disable a submit button in a simple form
629
//  consiting of a single input and a submit button
629
//  consiting of a single input and a submit button
630
//  Add 'formBtnEnable' to the input element.
630
//  Add 'formBtnEnable' to the input element.
631
//
631
//
632
$(document).ready(function () {
632
$(document).ready(function () {
633
    $('.formBtnEnable').closest('form').find(':submit').attr('disabled', true)
-
 
634
    $('.formBtnEnable').bind('keyup blur', function(){
633
    function formBtnSetState(){
635
        $(this).closest('form').find(':submit').attr('disabled', $(this).val().length ==0 );
634
        $(this).closest('form').find(':submit').attr('disabled', $(this).val().length ==0 );
636
    });
635
    }
-
 
636
    $('.formBtnEnable').each(formBtnSetState);
-
 
637
    $('.formBtnEnable').bind('keyup blur', formBtnSetState);
637
});
638
});
638
 
639
 
639
 
640
 
640
 
641
 
641
 
642