0

I am creating a dynamic component which will render select tags based on some API results, and I want to save the results of each selection in the select tags so I can use it later .. any help please ?

<Card>
  <Card.Header>
    <Card.Title as='h5'>Select questions and their answer to create the decision tree</Card.Title>
  </Card.Header>
  <Card.Body>

    {Object.entries(this.state.liste).map(([ke, values]) => {

      return (
        <div className="row ">
          <div className="col-xl-11">
            <h6 className="align-items-center float-left">{ke}</h6>
            <div className="progress-bar progress-c-theme" role="progressbar" style={{ width: '0%' }} aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" />
            <div className="text-right">
              <div className="col-md-11" style={{ width: '130px', height: '20px', top: '-20px', right: '-400px' }}>

                <select
                  key={ke}
                  name="secondSelectt"
                  value={this.state.answer}
                  onChange={(event) => this.handleChangeaa(event)
                  }
                >

                  {Object.values(values).map(key => {
                    return (
                      <option key={key} value={key}>{key}</option>)
                  })}

                </select> 

I have tried to use these couple of lines but it gives nothing and in the console it returns SyntheticEvent

95faf8e76605e973
  • 13,643
  • 3
  • 24
  • 51
Hkni
  • 115
  • 1
  • 11

0 Answers0