|
constructor() {
super(...arguments);
this.changeOption1 = () => {
document.getElementById("text").innerText =
"Selected : " + this.radioInstance1.value;
};
this.changeOption2 = () => {
document.getElementById("text").innerText =
"Selected : " + this.radioInstance2.value;
};
}
render() {
return (
<div className="control-pane">
<div className="control-section">
<div className="radiobutton-control">
<div id="text">Selected : Credit/Debit Card</div>
<div className="row">
<RadioButtonComponent
checked={true}
label="Credit/Debit card"
name="payment"
value="credit/debit"
change={this.changeOption3}
ref={radio1 => (this.radioInstance1 = radio1)}
/>
</div>
<div className="row">
<RadioButtonComponent
label="Net Banking"
name="payment"
value="netbanking"
change={this.changeOption2}
ref={radio2 => (this.radioInstance2 = radio2)}
/>
</div>
</div>
</div>
</div>
);
}
}
render(<RadioButton />, document.getElementById("sample"));
|