Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeforeRemove event #1568

Open
chuckvincent opened this issue Jun 24, 2024 · 2 comments
Open

BeforeRemove event #1568

chuckvincent opened this issue Jun 24, 2024 · 2 comments
Labels

Comments

@chuckvincent
Copy link

Description: Is there a way to add an event before the removal of a field that could stop the removal based on some logic. Similar to the onremove User Event, but I can not find a way to stop the removal once this event is fired.

Environment Details:

  • formBuilder Version:
  • Browser:
  • OS:

Expected Behavior

Actual Behavior

Steps to Reproduce

Screenshot - (optional)

@lucasnetau
Copy link
Collaborator

That's a useful feature request.

In the mean time you could try attaching an event handler to the delete button click event and prevent it bubbling up to the stages handler in formBuilder

$('.delete-confim').on('click', e => {
    e.stopImmediatePropagation();
...

@chuckvincent
Copy link
Author

chuckvincent commented Jul 1, 2024

Thanks for the hint, but I am using a function to create the form so I am unable the register an event handler when the page loads for a class that does not exist. I am NOT a JS expert, is there a way around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants