-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complicated to get value from radio button #151
Comments
Nor can initially make a choice. I think a different approximation can make easy. could be {
_onChange: function(event, value) {
var updated = {};
updated[event.target.name] = value;
this.setState(updated);
},
render: function() {
return (
<RadioGroupButton ref="shipSpeed" name="shipSpeed" value={this.state.shipSpeed} onChange={this,_onChange}>
<RadioButton name="choice_1" value="light" label="prepare for light speed"/>
<RadioButton name="choice_2" value="not_light" label="light speed too slow"/>
<RadioButton name="choice_3" value="ludicrous" label="go to ludicous speed"/>
</RadioGroupButton>
);
}
} you can use |
I had the same issue and I ended up creating something to help: I will submit a proper pull request with the code and documentation if it is deemed worthy. In the meantime, you should be able to get something working based on my gist. |
Thanks for solutions
|
@dankins's RadioButtonGroup is very good. thank you! |
Fixed with #267 |
I have two radio buttons and I want to get value for checked
Currently I am doing
But I think it's complicated
I think solution should be something like
The text was updated successfully, but these errors were encountered: