Skip to content

[up-validate] but also target another fragment #609

Answered by triskweline
LaundroMat asked this question in Q&A
Discussion options

You must be logged in to vote

Only submit when an input field loses focus using only unpoly selectors (and no custom JS)

You could auto-submit a form after a change event, targeting the .last_updated_on element outside the form:

<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.

Or tell [up-validate] it should update a fragment outside of the form?

[up-validate] defaults to the current form group, but also accepts an arbitrary selector:

<form>
  <input type="text" up-validate=".last_updated_on">
</form>

<div class=".last_updated_on"></div>

Validations were designed for chang…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@LaundroMat
Comment options

Comment options

You must be logged in to vote
1 reply
@LaundroMat
Comment options

Answer selected by LaundroMat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants