JavaScript How to loop over form inputs and get values in react loop over form controls angular,loop over formarray,loop over

given the following:

constructor () {

    super();
    this.state = {
        inputs : [
            { type: 'email', placeholder: 'Email Address' }
        ]
    };

}

render () {
  return {
    <div>

    {
      // Itterates over all inputs in the current state
      this.state.inputs.map((item, i) => (
        <Input key={i} id={'input-' + i} ref={'input-' + i} type={item.type} placeholder={item.placeholder} />
      ))
    }

     <button onClick={this.submit.bind(this)}>submit</button>

   </div>

  };
}

How would i get the values once the form is submitted? e.g.

submit () {
  // Need to loop over inputs and get values for all of them.
}
Answer:1

I have the following javascript function that prevents form submission if all required fields are not complete and is part of a form I am creating using Google Apps Scripts. Note that the #...

I have the following javascript function that prevents form submission if all required fields are not complete and is part of a form I am creating using Google Apps Scripts. Note that the #...

I have an action creator which does an expensive calculation and dispatches an action every time the user inputs something (basically real time updating). However, if the user inputs multiple things, ...

I have an action creator which does an expensive calculation and dispatches an action every time the user inputs something (basically real time updating). However, if the user inputs multiple things, ...

How could I create Pyramide of Stars that increase every row by 2 like that: * * * * * * * * * * * * * * * * My currently code: for (var x = 0; x < 5; x++) { for (var y = 0; y <= x; y = y ...

How could I create Pyramide of Stars that increase every row by 2 like that: * * * * * * * * * * * * * * * * My currently code: for (var x = 0; x < 5; x++) { for (var y = 0; y <= x; y = y ...

This is driving me absolutely insane, and I just cannot see what I have done wrong. Please help before I start bibbling and gnawing my colleagues leg off. He doesn't deserve that. I have an object I ...

This is driving me absolutely insane, and I just cannot see what I have done wrong. Please help before I start bibbling and gnawing my colleagues leg off. He doesn't deserve that. I have an object I ...