You are viewing limited content. For full access, please sign in.

Question

Question

delete collection row before lookup

asked on September 7, 2018

I have a from with a collection (min 0 - max 3) that is filled by a lookup after user enters their username.

1.  They enter username, lookup fills 1 - 2 of the collection rows.

2. User clicks on Add and fills in info.

3. User then changes the username, a new lookup runs.

4. User then changes username back to theirs, the previously added row is still there and the values are blank. And because it's a required field it shows the input is not valid error.

Question: Is there a way to delete any rows added to the collection BEFORE the lookup runs? So that no matter how many times they change the username, or how many rows were filled via lookup, or added, it will always start as if the form was new?

0 0

Answer

SELECTED ANSWER
replied on September 7, 2018

Sounds like you want to utilize the "lookupstarted" event, or at the very least catch the "change" event for the field they are updated.

You would attach an event handler that loops through and removes the extra rows (I usually trigger .click() on the delete buttons) and that should do the trick.

See the following post for more info

https://answers.laserfiche.com/questions/108471/Can-we-get-a-lookups-complete-custom-event-listener-please#121241

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.