Merge branch '108-disable-2nd-click-on-new-jo-submission' into 'master'
Resolve "Disable 2nd click on new JO submission" Closes #108 See merge request jankstudio/resq!92
This commit is contained in:
commit
83de99aeca
1 changed files with 10 additions and 0 deletions
|
|
@ -802,6 +802,8 @@
|
|||
|
||||
<script>
|
||||
$(function() {
|
||||
var form_in_process = false;
|
||||
|
||||
// BEGIN google maps stuff
|
||||
function selectPoint(map, latlng) {
|
||||
var lat = latlng.lat();
|
||||
|
|
@ -899,6 +901,13 @@ $(function() {
|
|||
// END google maps stuff
|
||||
|
||||
$("#row-form").submit(function(e) {
|
||||
if (form_in_process) {
|
||||
alert("Cannot submit form twice. First submission still in progress.");
|
||||
return false;
|
||||
}
|
||||
|
||||
form_in_process = true;
|
||||
|
||||
var form = $(this);
|
||||
|
||||
// get all fields, including disabled ones
|
||||
|
|
@ -938,6 +947,7 @@ $(function() {
|
|||
});
|
||||
}).fail(function(response) {
|
||||
if (response.status == 422) {
|
||||
form_in_process = false;
|
||||
var errors = response.responseJSON.errors;
|
||||
var firstfield = false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue