* Convert the input values to localized 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 o
(forcedOutputFormat = null, callback = null)
| 3403 | * @returns {AutoNumeric} |
| 3404 | */ |
| 3405 | formSubmitLocalized(forcedOutputFormat = null, callback = null) { //FIXME test this |
| 3406 | if (AutoNumericHelper.isNull(callback)) { |
| 3407 | this.formUnformatLocalized(); |
| 3408 | this.form().submit(); |
| 3409 | this.formReformat(); |
| 3410 | } else if (AutoNumericHelper.isFunction(callback)) { |
| 3411 | callback(this.formLocalized(forcedOutputFormat)); |
| 3412 | } else { |
| 3413 | AutoNumericHelper.throwError(`The given callback is not a function.`); |
| 3414 | } |
| 3415 | |
| 3416 | return this; |
| 3417 | } |
| 3418 | |
| 3419 | /** |
| 3420 | * Generate an array of numeric strings from the `<input>` elements, and pass it to the given callback. |
no test coverage detected