fix: prevent forms submitting multiple times
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-03 17:16:01 +08:00
parent 5531233763
commit e79128ad94
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -665,7 +665,12 @@ class UOJForm {
EOD; EOD;
} else { } else {
echo <<<EOD echo <<<EOD
if (ok) $("#button-submit-{$this->form_name}").addClass('disabled'); if (ok) {
$("#button-submit-{$this->form_name}").addClass('disabled');
$(this).submit(function () {
return false;
});
}
return ok; return ok;
EOD; EOD;
} }