ariovistus / aurelia-mask

port of ui-mask to aurelia
MIT License
7 stars 3 forks source link

Aurelia Validation issue #12

Closed arashnorouzi closed 6 years ago

arashnorouzi commented 7 years ago

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.

ariovistus commented 7 years ago

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.

jared-jacobson commented 6 years ago

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

ariovistus commented 6 years ago

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?

ariovistus commented 6 years ago

assuming resolved due to lack of activity