3 回答
TA贡献1784条经验 获得超9个赞
orm.js
var React = require('react');
var ReactDOM = require('react-dom');
var {Form, Input} = require('react-form');
var {Password, Text} = require('react-form-inputs');
var LoginForm = React.createClass({
render() {
return (
<div>
<Form {...this.props} for="user">
<h1>Login</h1>
<Input type={Text} for="username" placeholder="Username" />
<Input type={Password} for="password" placeholder="Password" />
<input type="submit" value="Login" />
</Form>
</div>
TA贡献1943条经验 获得超7个赞
问题并么有解决 , 使用不同的name值 ,并没有实现单选按钮的效果 ,三个按钮仍然能同时选中
const SexRadio=React.createClass({
getInitialState:function(){
return {}
},
render:function(){
return (
<div>
<form name="form1">
<input type="radio" name="radiobutton1" value="radiobutton" checked /> 喜欢
<input type="radio" name="radiobutton2" value="radiobutton" /> 不喜欢
<input type="radio" name="radiobutton3" value="radiobutton"/> 无所谓<br/>
</form>
</div>
);
}
});
ReactDOM.render(<SexRadio/>,document.getEl
- 3 回答
- 0 关注
- 2166 浏览
添加回答
举报