Forms & Last Step

- fixed issues on forms
- added defaultValue on text/textarea fields
- added all actions on step 3
This commit is contained in:
Jonathan Labreuille
2015-10-01 14:22:53 +02:00
parent 39b2a2ad40
commit dc2b3733d7
8 changed files with 74 additions and 43 deletions

View File

@ -15,7 +15,7 @@ function(
FormFieldCheckbox
) {
var FormField = React.createClass({
renderField: function(data, inline = true) {
renderField: function(data, inline = false) {
var description = false;
if(data.field.description) {
description = (
@ -53,17 +53,17 @@ function(
if(inline === true) {
return (
<span>
<span key={ 'field-' + (data.index || 0) }>
{ field }
{ description }
</span>
);
} else {
return (
<div>
<p key={ 'field-' + (data.index || 0) }>
{ field }
{ description }
</div>
</p>
);
}
},
@ -71,8 +71,9 @@ function(
var field = false;
if(this.props.field['fields'] !== undefined) {
field = this.props.field.fields.map(function(subfield) {
field = this.props.field.fields.map(function(subfield, index) {
return this.renderField({
index: index,
field: subfield,
item: this.props.item
});