On the bases of the value of radio button(html mention below) I want to mark checkbox as checked or unchecked. Below is my code which is not working.
Thank you for your suggestions.
Radio button
<Input
type="radio"
name="radio1"
value="No"
defaultChecked
onChange={ (e) => {
this.setState({
auto_registration: e.target.value
})
} } />
<Input
type="radio"
name="radio1"
value="Yes"
onChange={ (e) => {
this.setState({
auto_registration: e.target.value
})
} } />
Checkbox
<Input
type="checkbox"
defaultChecked={ this.state.auto_registration && this.state.auto_registration == "Yes" ? true : false }
disabled={ this.state.auto_registration && this.state.auto_registration == "Yes" ? true : false } />