Skip to main content

forEach()

iterates over all controls of a form

forEach(callback: FormDataCallback): void;

Parameters:

callback: function - a function that will iterate over Form controls

Example

form.forEach(function(item, index, array) {    console.log("This is the form control: ", item);    console.log("This is the index of form control : ", index);    console.log("This is the array with form controls: ", array);});

Related sample: Form. ForEach

The callback function takes three parameters:

item(object) the object of a form control
index(number) the index of a form control
array(array) an array with form controls

Change log:

added in v6.4