MCPcopy Index your code
hub / github.com/autoNumeric/autoNumeric / formSubmitFormatted

Method formSubmitFormatted

src/AutoNumeric.js:3384–3394  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 1

Calls 5

formMethod · 0.95
formFormattedMethod · 0.95
isNullMethod · 0.80
isFunctionMethod · 0.80
throwErrorMethod · 0.80

Tested by

no test coverage detected