Fix for bank accounts
This commit is contained in:
parent
785e5ecbcc
commit
ea54741075
1 changed files with 18 additions and 18 deletions
|
|
@ -62,6 +62,24 @@
|
|||
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
||||
NINJA.loggedErrorCount = 0;
|
||||
|
||||
NINJA.parseFloat = function(str) {
|
||||
if (! str) {
|
||||
return '';
|
||||
} else {
|
||||
str = str + '';
|
||||
}
|
||||
|
||||
// check for comma as decimal separator
|
||||
if (str.match(/,[\d]{1,2}$/)) {
|
||||
str = str.replace(',', '.');
|
||||
str = str.replace('.', ',');
|
||||
}
|
||||
|
||||
str = str.replace(/[^0-9\.\-]/g, '');
|
||||
|
||||
return window.parseFloat(str);
|
||||
}
|
||||
|
||||
window.onerror = function (errorMsg, url, lineNumber, column, error) {
|
||||
if (NINJA.loggedErrorCount > 5) {
|
||||
return;
|
||||
|
|
@ -306,24 +324,6 @@
|
|||
<script type="text/javascript">
|
||||
NINJA.formIsChanged = {{ isset($formIsChanged) && $formIsChanged ? 'true' : 'false' }};
|
||||
|
||||
NINJA.parseFloat = function(str) {
|
||||
if (! str) {
|
||||
return '';
|
||||
} else {
|
||||
str = str + '';
|
||||
}
|
||||
|
||||
// check for comma as decimal separator
|
||||
if (str.match(/,[\d]{1,2}$/)) {
|
||||
str = str.replace(',', '.');
|
||||
str = str.replace('.', ',');
|
||||
}
|
||||
|
||||
str = str.replace(/[^0-9\.\-]/g, '');
|
||||
|
||||
return window.parseFloat(str);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('form.warn-on-exit input, form.warn-on-exit textarea, form.warn-on-exit select').change(function () {
|
||||
NINJA.formIsChanged = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue