Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
handleInputChangeDom = (event) => {
  const target = event.target;
  var value = target.value;
  const Address_type = this.state.Address_type;

  if (event.target.checked) {
    Address_type.push(event.target.value);
  } else {
    let index = Address_type.indexOf(event.target.value);
    Address_type.splice(index, 1);
  }

  this.setState({
    Address_type: Address_type,

  });
};


What I have tried:

I am here able to push only the checkboxes which I used to check but there is a checkbox which is default checked how can I push to this array
Posted
Comments
[no name] 13-May-21 12:55pm    
I don't know "ReactJS", but I do know check boxes, and I don't see anything that looks like one in your code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900