Skip to content

Commit

Permalink
set form validate rules for contact
Browse files Browse the repository at this point in the history
  • Loading branch information
SebDez committed Mar 2, 2017
1 parent d5de1bb commit b53452a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/module/contact/component/contact-form-component.js
Expand Up @@ -33,12 +33,12 @@ export class ContactFormComponent extends FormComponent {
/>
<Field name='subject' type='text'
component={this.formHelper.renderField.bind(this.formHelper)} label={this.i18n.t('application.contact.subject')}
validate={[ this.formHelper.isRequired, this.formHelper.isMoreThanMaxLength(15) ]}
validate={[ this.formHelper.isRequired, this.formHelper.isLessThanMinLength(5), this.formHelper.isMoreThanMaxLength(100) ]}
warn={this.formHelper.adviceDemo}
/>
<Field name='content' type='text'
component={this.formHelper.renderField.bind(this.formHelper)} label={this.i18n.t('application.contact.content')}
validate={[ this.formHelper.isRequired, this.formHelper.isLessThanMinLength(5) ]}
validate={[ this.formHelper.isRequired, this.formHelper.isLessThanMinLength(10), this.formHelper.isMoreThanMaxLength(2000) ]}
/>
<button type='submit'>Submit</button>
</form>
Expand Down

0 comments on commit b53452a

Please sign in to comment.