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