* Convert the input values to numeric strings, submit the form, then reformat those back. * The function can either take a callback, or not. If it doesn't, the default `form.submit()` function will be called. * Otherwise, it runs `callback(value)` with `value` being equal to the result of
(callback = null)
| 3360 | * @returns {AutoNumeric} |
| 3361 | */ |
| 3362 | formSubmitNumericString(callback = null) { //FIXME test this |
| 3363 | if (AutoNumericHelper.isNull(callback)) { |
| 3364 | this.formUnformat(); |
| 3365 | this.form().submit(); |
| 3366 | this.formReformat(); |
| 3367 | } else if (AutoNumericHelper.isFunction(callback)) { |
| 3368 | callback(this.formNumericString()); |
| 3369 | } else { |
| 3370 | AutoNumericHelper.throwError(`The given callback is not a function.`); |
| 3371 | } |
| 3372 | |
| 3373 | return this; |
| 3374 | } |
| 3375 | |
| 3376 | /** |
| 3377 | * Submit the form with the current formatted values. |
no test coverage detected