mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-23 03:12:14 +00:00
ReAdded a lastErroredInput
to get the last error
This commit is contained in:
parent
b2c238ea13
commit
bb85279818
@ -127,6 +127,15 @@ export default class FormManager {
|
|||||||
*/
|
*/
|
||||||
private FMInputs: FMAssignInterface[] = []
|
private FMInputs: FMAssignInterface[] = []
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The last verified `FMInput` that returned an error
|
||||||
|
*
|
||||||
|
* @type {FMInput}
|
||||||
|
* @memberof FormManager
|
||||||
|
*/
|
||||||
|
public lastErroredInput: FMInput
|
||||||
|
|
||||||
|
|
||||||
private _form: HTMLFormElement
|
private _form: HTMLFormElement
|
||||||
/**
|
/**
|
||||||
* The Form Element of the FM
|
* The Form Element of the FM
|
||||||
@ -229,9 +238,13 @@ export default class FormManager {
|
|||||||
for (const name in this.inputs) {
|
for (const name in this.inputs) {
|
||||||
if (this.inputs.hasOwnProperty(name)) {
|
if (this.inputs.hasOwnProperty(name)) {
|
||||||
const input = this.inputs[name];
|
const input = this.inputs[name];
|
||||||
if(!input.verify()) return false
|
if(!input.verify()) {
|
||||||
|
this.lastErroredInput = input
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.lastErroredInput = undefined
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user