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

Is there a way to limit questions (controls) that can be added to form? #1303

Open
mkgn opened this issue May 17, 2022 · 3 comments
Open

Is there a way to limit questions (controls) that can be added to form? #1303

mkgn opened this issue May 17, 2022 · 3 comments
Labels
enhancement ♥ NEEDS SPON$OR Help bring this feature to the plugin

Comments

@mkgn
Copy link

mkgn commented May 17, 2022

I am trying to use this for a survey tool. I want to limit the questions a user can add to form. For example, If I set a limit of 10, then user should only be able to drag and drop 10 controls to the form.

Is there an event or something that I can use to count and stop adding controls if the limit has reached?

@Jojoshua
Copy link
Collaborator

@lucasnetau
Copy link
Collaborator

Out of the box there is no way to limit the number of controls. The desired effect can be achieved via hooking into the onadd and onremove events of typeUserEvents (using wildcard *) and disabling/enabling pointer events on the controls based on the count of element on the stage.

Have marked as NEEDS SPONSOR if anyway wishes to sponsor development of built in functionality

@kevinchappell
Copy link
Owner

Happy to take this on as a sponsored feature but for now this can be accomplished with typeUserEvents like @Jojoshua mentioned or even outside of the plugin. https://codepen.io/kevinchappell/pen/eZReEB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ♥ NEEDS SPON$OR Help bring this feature to the plugin
Projects
None yet
Development

No branches or pull requests

4 participants