ariovistus/aurelia-mask

Aurelia Validation issue

Closed this issue · 4 comments

Hi,
Thanks for such a great plugin.
Unfortunately, I can not get Aurelia validation working with this plugin.

<input masked="value.bind: newMember.contactInfo.mobilePhone & validate; mask: (999) 999-9999; placeholder: *" />

I got evenything form docs and just added the validate to the end.
Not sure if im missing something but all other inputs validation works perfrctly fine.

I have a project with aurelia-mask 1.4.0 and aurelia-validation 1.0.0, and validation works fine for me. I see two differences between yours and mine:

<input class='form-control' masked="value.bind: newMember.contactInfo.mobilePhone & validate:rules; mask: (999) 999-9999; placeholder: *" />

I'm using a custom renderer and bootstrap styling, hence the class='form-control'. Can you tell if validation is not rendering for you, or if it isn't being run at all for that field?
The validate:rules is more due to the way I set validation up; it probably isn't significant if you have it working for other fields.

Thanks ariovistus I had

<input class='form-control' masked="value: newMember.contactInfo.mobilePhone & validate:rules; mask: (999) 999-9999; placeholder: *" />

instead of:

<input class='form-control' masked="value.bind: newMember.contactInfo.mobilePhone & validate:rules; mask: (999) 999-9999; placeholder: *" />

I am using the

<div class="row">
  <ul>
        <li repeat.for='e of controller.errors'>
               ${e.message}
        </li>
  </ul>
</div>

For rendering though. The control itself does not show any visible signs of validating

Can you tell if it is not triggering or not displaying? if you put, say, a custom validation rule (satisfies) with a debugger statement in it, does the custom rule get called when you edit the field or tab away?

assuming resolved due to lack of activity