mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Don't forget form values on error
This commit is contained in:
parent
7aa4d50560
commit
a6df6ca29b
@ -53,10 +53,10 @@ module.exports = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<form onSubmit={this.onInitialStageSubmit}>
|
<form onSubmit={this.onInitialStageSubmit}>
|
||||||
Email: <input type="text" ref="email" /><br />
|
Email: <input type="text" ref="email" defaultValue={this.savedParams.email} /><br />
|
||||||
Username: <input type="text" ref="username" /><br />
|
Username: <input type="text" ref="username" defaultValue={this.savedParams.username} /><br />
|
||||||
Password: <input type="password" ref="password" /><br />
|
Password: <input type="password" ref="password" defaultValue={this.savedParams.password} /><br />
|
||||||
Confirm Password: <input type="password" ref="confirmPassword" /><br />
|
Confirm Password: <input type="password" ref="confirmPassword" defaultValue={this.savedParams.confirmPassword} /><br />
|
||||||
<ServerConfig ref="serverConfig" />
|
<ServerConfig ref="serverConfig" />
|
||||||
<input type="submit" value="Continue" />
|
<input type="submit" value="Continue" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -42,6 +42,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
|
this.savedParams = {
|
||||||
|
email: '',
|
||||||
|
username: '',
|
||||||
|
password: '',
|
||||||
|
confirmPassword: ''
|
||||||
|
};
|
||||||
this.readNewProps();
|
this.readNewProps();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -163,6 +169,7 @@ module.exports = {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
var formVals = this.getRegFormVals();
|
var formVals = this.getRegFormVals();
|
||||||
|
this.savedParams = formVals;
|
||||||
|
|
||||||
var badFields = {};
|
var badFields = {};
|
||||||
if (formVals.password != formVals.confirmPassword) {
|
if (formVals.password != formVals.confirmPassword) {
|
||||||
|
Loading…
Reference in New Issue
Block a user