简体   繁体   中英

required validation rule message show every time

I have a fiddle in which i am using knockout.js. I created a custom validation for checking dupplicate entry in array and using a native validation ("required") . Custom validation is working properly but native validation is not. Please take a lool to this fiddle :

http://jsfiddle.net/hsnCW/3/

EDIT

You can re-generate the issue by first add empty entry and then add new entry.Than you will see that while adding empty entry you will not see the validation error message , you will see the message when you will add the valid entry.How to solve this issue?

This is happening because of the "field reset"

self.newItem(null);

Add self.newItem.isModified(false); after that to reset the modified status of the field.

Updated fiddle: http://jsfiddle.net/hsnCW/4/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM