Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
c25852b3
Commit
c25852b3
authored
Jul 01, 2016
by
Ray Schamp
Committed by
GitHub
Jul 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #657 from rschamp/bugfix/645
Revalidate address step after invalid submissions
parents
d432282f
a56f9948
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/components/forms/form.jsx
src/components/forms/form.jsx
+14
-3
No files found.
src/components/forms/form.jsx
View file @
c25852b3
var
classNames
=
require
(
'
classnames
'
);
var
classNames
=
require
(
'
classnames
'
);
var
Formsy
=
require
(
'
formsy-react
'
);
var
Formsy
=
require
(
'
formsy-react
'
);
var
omit
=
require
(
'
lodash.omit
'
);
var
React
=
require
(
'
react
'
);
var
React
=
require
(
'
react
'
);
var
GeneralError
=
require
(
'
./general-error.jsx
'
);
var
GeneralError
=
require
(
'
./general-error.jsx
'
);
var
validations
=
require
(
'
./validations.jsx
'
).
validations
;
var
validations
=
require
(
'
./validations.jsx
'
).
validations
;
...
@@ -11,17 +12,27 @@ for (var validation in validations) {
...
@@ -11,17 +12,27 @@ for (var validation in validations) {
var
Form
=
React
.
createClass
({
var
Form
=
React
.
createClass
({
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
return
{
return
{
noValidate
:
true
noValidate
:
true
,
onChange
:
function
()
{}
};
};
},
},
getInitialState
:
function
()
{
return
{
allValues
:
{}
};
},
onChange
:
function
(
currentValues
,
isChanged
)
{
this
.
setState
({
allValues
:
omit
(
currentValues
,
'
all
'
)});
this
.
props
.
onChange
(
currentValues
,
isChanged
);
},
render
:
function
()
{
render
:
function
()
{
var
classes
=
classNames
(
var
classes
=
classNames
(
'
form
'
,
'
form
'
,
this
.
props
.
className
this
.
props
.
className
);
);
return
(
return
(
<
Formsy
.
Form
{
...
this
.
props
}
className=
{
classes
}
>
<
Formsy
.
Form
{
...
this
.
props
}
className=
{
classes
}
ref=
"formsy"
onChange=
{
this
.
onChange
}
>
<
GeneralError
name=
"all"
/>
<
GeneralError
name=
"all"
value=
{
this
.
state
.
allValues
}
/>
{
this
.
props
.
children
}
{
this
.
props
.
children
}
</
Formsy
.
Form
>
</
Formsy
.
Form
>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment