* Submit the form with the current formatted values. * 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 `formFormatted()`. * * @par
(callback = null)
| 3382 | * @returns {AutoNumeric} |
| 3383 | */ |
| 3384 | formSubmitFormatted(callback = null) { //FIXME test this |
| 3385 | if (AutoNumericHelper.isNull(callback)) { |
| 3386 | this.form().submit(); |
| 3387 | } else if (AutoNumericHelper.isFunction(callback)) { |
| 3388 | callback(this.formFormatted()); |
| 3389 | } else { |
| 3390 | AutoNumericHelper.throwError(`The given callback is not a function.`); |
| 3391 | } |
| 3392 | |
| 3393 | return this; |
| 3394 | } |
| 3395 | |
| 3396 | /** |
| 3397 | * Convert the input values to localized strings, submit the form, then reformat those back. |
no test coverage detected