Closed jkesselring-zz closed 8 years ago
Sorry I don't quite follow - you don't have a value binding in there anywhere. When you say it doesn't work could you be more descriptive so I can reproduce what you mean?
Sorry. The issue that I am having is that the fields in the form that are not behind an if.bind are validated correctly. However, the form fields behind the if.bind do not validate.
When the page loads initially any field that is there regardless of the if bind are validating as one would expect. When the user causes the if binding to be true then the form is given further fields. These fields that were loaded after into the DOM are not validating. Even as the validation and fields are bound to the object that I am validating on.
Think I have found the same problem as this.. If you take the following form :
<form validate.bind="validation">
<div if.bind="showForename">
<div class="form-group">
<input type="text" value.bind="Forename" />
</div>
</div>
<div class="form-group">
<input type="text" value.bind="Surname" />
</div>
</form>
For me, when Forename gets displayed, even though validation does work the validationViewStrategy doesn't add the attributes to the form. I'm using my own strategy here and prepareElement / updateElement are never called for the newly created/bound Forename element.
@PWKad With a potential rewrite will this issue be solved?
Thanks for submitting this / commenting on this. At this time we are closing this because we have completely re-written and are deprecating the previous feature set. If you feel this should be re-opened please feel free to review this blog post and submit either again on this repository, or on the new validatejs bridge repository
Thanks again!
Validation does not function when interacting with if.bindings. The initial elements are bound to correctly and validate the first However the elements that are not yet in the DOM are not bound to when they are loaded into the DOM.
There should a means of binding to these elements for validation.
As expected an input as such works.
An input as below does not work.