Knockout-Contrib / Knockout-Contrib/Knockout-Validation
Issue with knockout custom validators on observablearray
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 366
- PR merge metrics
- No merged PRs in 30d
Description
Here is the fiddle that demonstrate my issue:
http://jsbin.com/ocizes/19/edit
I have two validation rules on the values of the observable array WeeklyData(). one is for min/max validation other to make sure the values are given in 15 min. increments.
problems:
1) when I update the textbox values, the validation doesn't fire. Only when I change the observablearray values in code the validation fires. How can I fix that.
2) when I have multiple validators defined on a single observable array, only one of them fires. Not both. For example, a value such as 205 should fail both validations (min-max validation and 15 min format), but only the first one is fired. Is there a way to show both?
3) I want the '*' to be displayed against each texbox in the array, in the case of a validation failure. How to do that?
Thanks in advance for any help.
Contributor guide
Research direction
Start with the linked JS Bin and reproduce the three observablearray custom-validator cases: textbox updates, multiple validators, and per-textbox asterisks. Done means identifying behavior for each case and documenting or testing a fix that triggers validation on edits, reports both failures, and displays the marker beside each invalid textbox.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100