Merge pull request #17965 from OPEN-DSI/new-expensereport-prevent-submit-on-enter-key
NEW prevent default submit form on enter key in expense card
This commit is contained in:
commit
bbc6e9d8ac
@ -2191,17 +2191,34 @@ if ($action == 'create') {
|
|||||||
$( ".auploadnewfilenow" ).click(function() {
|
$( ".auploadnewfilenow" ).click(function() {
|
||||||
jQuery(".truploadnewfilenow").toggle();
|
jQuery(".truploadnewfilenow").toggle();
|
||||||
jQuery(".trattachnewfilenow").hide();
|
jQuery(".trattachnewfilenow").hide();
|
||||||
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", false);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$( ".aattachtodoc" ).click(function() {
|
$( ".aattachtodoc" ).click(function() {
|
||||||
jQuery(".trattachnewfilenow").toggle();
|
jQuery(".trattachnewfilenow").toggle();
|
||||||
jQuery(".truploadnewfilenow").hide();
|
jQuery(".truploadnewfilenow").hide();
|
||||||
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", false);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});';
|
});';
|
||||||
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array'))) {
|
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array'))) {
|
||||||
print 'jQuery(".trattachnewfilenow").toggle();'."\n";
|
print 'jQuery(".trattachnewfilenow").toggle();'."\n";
|
||||||
}
|
}
|
||||||
print '
|
print '
|
||||||
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", false);
|
||||||
|
}
|
||||||
|
';
|
||||||
|
print '
|
||||||
});
|
});
|
||||||
';
|
';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
@ -2337,17 +2354,34 @@ if ($action == 'create') {
|
|||||||
$( ".auploadnewfilenow" ).click(function() {
|
$( ".auploadnewfilenow" ).click(function() {
|
||||||
jQuery(".truploadnewfilenow").toggle();
|
jQuery(".truploadnewfilenow").toggle();
|
||||||
jQuery(".trattachnewfilenow").hide();
|
jQuery(".trattachnewfilenow").hide();
|
||||||
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", false);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$( ".aattachtodoc" ).click(function() {
|
$( ".aattachtodoc" ).click(function() {
|
||||||
jQuery(".trattachnewfilenow").toggle();
|
jQuery(".trattachnewfilenow").toggle();
|
||||||
jQuery(".truploadnewfilenow").hide();
|
jQuery(".truploadnewfilenow").hide();
|
||||||
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", false);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});'."\n";
|
});'."\n";
|
||||||
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')) && $action != 'updateline') {
|
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')) && $action != 'updateline') {
|
||||||
print 'jQuery(".trattachnewfilenow").show();'."\n";
|
print 'jQuery(".trattachnewfilenow").show();'."\n";
|
||||||
}
|
}
|
||||||
print '
|
print '
|
||||||
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
jQuery("input[name=\"sendit\"]").prop("disabled", false);
|
||||||
|
}
|
||||||
|
';
|
||||||
|
print '
|
||||||
});
|
});
|
||||||
';
|
';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user