一开始我想说,我是初学者,几乎不知道任何事情=)
所以我有一个JSX脚本,它从input
字段中获取数据。
render: function () {
var disabledSubmitButton = this.state.SubmitButtonDisabled ? 'disabled' : '';
var disabledPortInput = this.state.IsPortInputDisabled ? 'disabled' : '';
return (
<form className="form" method="post" onSubmit={this.handleSubmit}>
<br />
<div className="form-group">
<input className="form-control" name="Id" type="hidden" placeholder="Id" ref="id" onChange={this.handleChange} />
</div>
<div className="form-group">
<input className="form-control" name="UserName" type="text" placeholder="Имя пользователя" ref="username" onChange={this.handleChange} />
</div>
<div className="form-group">
<input className="form-control" name="PasswordHash" type="password" placeholder="Пароль" ref="passwordhash" onChange={this.handleChange} />
</div>
<div className="form-group">
<input className="form-control" name="Email" type="text" placeholder="E-mail" ref="email" onChange={this.handleChange} />
</div>
<div className="form-group">
<input className="form-control" name="UserRoles" type="text" placeholder="Роль пользователя" ref="userroles" onChange={this.handleChange} />
</div>
<input className="btn btn-default" value="Submit" type="submit" disabled={disabledSubmitButton} />
</form>
);
但是我需要为电子邮件和密码字段添加屏蔽输入,那么我该怎么做呢? (最好只有反应的力量)