javascript - show validation message after user enters invalid value and focused out and then on keyup,using knockout validation -


i using knockout validation validate data before updating in db. not familiar knockout validation. "valueupdate" in data-bind input box "afterkeydown", which, each time giving invalid value message coming up. want show message after user first time focused out input box. after want show message on key up. if can set valueupdate after focus out view model, may help. since having other bindings in data-bind, can't add data-bind attribute vm. checkedthis link.

any idea how this?

your fiddle example using knockout 2.3. if use knockout 3+ can use textinput binding.

the textinput binding links text box () or text area () viewmodel property, providing two-way updates between viewmodel property , element’s value. unlike value binding, textinput provides instant updates dom types of user input, including autocomplete, drag-and-drop, , clipboard events.

so instead of:

<input data-bind='value: emailaddress,valueupdate:"keyup"' required pattern="@"/>

your binding like:

<input data-bind='textinput: emailaddress' required pattern="@"/>

here updated fiddle: https://jsfiddle.net/mx45nnl6/2/


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -