casperin/nod

display: none; isn't removed from valid message

Closed this issue · 1 comments

I added a custom successMessageClass and successClass but it isn't removing the display: none; from the message span now. I do not use messages tho, my code sample:

var myNod = nod();

myNod.configure({
  submit: ".button",
  disableSubmit: true,
  successClass: "is-valid",
  successMessageClass: "ion-checkmark",
  errorClass: "is-invalid",
  errorMessageClass: "ion-close",
  parentClass: "form-group",
  delay: 1500
});

myNod.add([{
  selector: ".check-email",
  validate: "email",
  triggerEvents: "blur"
}, {
  selector: ".check-field",
  validate: "presence",
  triggerEvents: "blur"
}, {
  selector: ".check-password",
  validate: "min-length:6",
  triggerEvents: "blur"
}]);

Am I doing anything wrong here?
I fixed it for now by adding display: block !Important; in CSS but I do not like that :)

Another thing I was wondering about: When my form errors anyway after clicking submit, the user has to tab over all fields again so they get flagged valid before he/she can submit again (with disableSubmit on). Any idea on how to avoid that?

Hi @nielsenramon, thanks for opening this; and shame on me for not responding in a timely fashion... merry xmas though!

Did you work it out? Move on? Don't care anymore? ... That's what I imagine anyway, so I'll close this for now; and if it is still an issue, then just reopen it and I'll sit down and work out the problem. If you're feeling reeeaaally gracious, then you can help me out by creating a jsfiddle or codepen.