0

i have a simple form

 <form onSubmit = {handleSubmit} encType="multipart/form-data" id="form_id">
    <Row>
      <Col >
        <input
          name= "more"
          title = "More"
          type="file"
        />
      </Col>
    </Row>
  </form>

Once the value of input is changed, i catch that event in another method and when i tried to create a FormData object and pass the form to the constructor of FormData, it still give me an empty object, here's what i tried to do:

  var f =new FormData(document.getElementById('form_id'));
  f.append("file","some value");

can any one suggest a solution please ?

M1M6
  • 915
  • 3
  • 17
  • 33

1 Answers1

-1
var f = new FormData(document.getElementById('form_id'));
f.append("file", $('input-selector')[0].files)
Kenneth Voss
  • 49
  • 1
  • 3