mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-22 19:02:15 +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[] = []
|
||||
|
||||
/**
|
||||
* The last verified `FMInput` that returned an error
|
||||
*
|
||||
* @type {FMInput}
|
||||
* @memberof FormManager
|
||||
*/
|
||||
public lastErroredInput: FMInput
|
||||
|
||||
|
||||
private _form: HTMLFormElement
|
||||
/**
|
||||
* The Form Element of the FM
|
||||
@ -229,9 +238,13 @@ export default class FormManager {
|
||||
for (const name in this.inputs) {
|
||||
if (this.inputs.hasOwnProperty(name)) {
|
||||
const input = this.inputs[name];
|
||||
if(!input.verify()) return false
|
||||
if(!input.verify()) {
|
||||
this.lastErroredInput = input
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
this.lastErroredInput = undefined
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user