diff --git a/examples/README.md b/examples/README.md index 691cc4f..e542748 100644 --- a/examples/README.md +++ b/examples/README.md @@ -34,3 +34,7 @@ If it is not helped try update your node.js and npm. 3. [**Reset Values**](reset-values) Reset text input, checkbox and select to their pristine values. + +4. [**Dynamic Form Fields**](dynamic-form-fields) + + Dynamically adding and removing fields to form. diff --git a/examples/components/Input.js b/examples/components/Input.js index a73e060..fd66834 100644 --- a/examples/components/Input.js +++ b/examples/components/Input.js @@ -18,14 +18,15 @@ const MyInput = React.createClass({ // when the value is empty and the required prop is // passed to the input. showError() is true when the // value typed is invalid - const className = this.props.className + ' ' + (this.showRequired() ? 'required' : this.showError() ? 'error' : null); + const className = 'form-group' + (this.props.className || ' ') + + (this.showRequired() ? 'required' : this.showError() ? 'error' : ''); // An error message is returned ONLY if the component is invalid // or the server has returned an error message const errorMessage = this.getErrorMessage(); return ( -