[up-validate] but also target another fragment #609
-
If I understand correctly, [up-validate] will only rerender the form (from the docs):
I would like to update another fragment (.last_updated_on) after submitting the form. I'm using [up-validate] to trigger a submit when an input field loses focus. I can't immediately see another way of doing this without resorting to custom JavaScript. Is there a way to either:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I don't believe you can get
Another option, which I haven't tested, is returning a modified I'd suggest making a common selector that you could apply |
Beta Was this translation helpful? Give feedback.
-
You could auto-submit a form after a <form up-autosubmit up-target=".last_updated_on" up-watch-event="change">
<input type="text">
</form>
<div class=".last_updated_on"></div> You can also target multiple fragments like this.
<form>
<input type="text" up-validate=".last_updated_on">
</form>
<div class=".last_updated_on"></div> Validations were designed for changes within a form before submission (to verify input or update dependent fields. I would go with |
Beta Was this translation helpful? Give feedback.
You could auto-submit a form after a
change
event, targeting the.last_updated_on
element outside the form:You can also target multiple fragments like this.
[up-validate]
defaults to the current form group, but also accepts an arbitrary selector:Validations were designed for chang…