lundi 6 juin 2016

ember form input validation

I am using - http://ift.tt/1Utn5nw

I would like to add bootstrap styling to my form fieldsets to say whether they are valid or invalid.

I can get it to add the bootstrap form class 'has-danger' if there is an error. But when the error is correct I cannot get it to change to 'has-success'.

below is a section of my form: signup.hbs

<fieldset class="form-group row has-success ">
    <label class="col-md-3 form-control-label">
        Password
    </label>
    <div class="col-md-6">
        
    </div>
    <div class="col-md-7 col-md-offset-3 input-error">
        
    </div>
</fieldset>

below is a snippet from my validation file: validation.js

export const name = validator('presence', true)
export const password = [
  validator('presence', true),
  validator('length', {
    min: 4,
    max: 8,
    message: 'Please make sure the password is 4 - 8 characters long'
  }),
]




Aucun commentaire:

Enregistrer un commentaire