mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 03:26:06 +01:00
Disable submit buttons while performing validation
This commit is contained in:
@@ -12,12 +12,14 @@ $(function(){
|
||||
|
||||
function validate(e){
|
||||
var form = $(e.target);
|
||||
$(form).find('[type=submit]').attr('disabled', 'disabled')
|
||||
|
||||
if(form.data('validated') == true){
|
||||
return true;
|
||||
}
|
||||
|
||||
$.post(form.attr('action') + '/validate', $(e.target).serialize(), function(data){
|
||||
$(form).find('[type=submit]').removeAttr('disabled')
|
||||
// clear all error messages
|
||||
$('.error').text('');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user