Issue #2864Opened July 1, 2020by fcnyp0 reactions

[QUESTION] Require trait, check status

Question

I have a project that requires a form, currently using the form plugin, and each element of the form requires a name. While this is a trait, is it possible to require a trait and check all nodes to determine if they meet their requirement?

Following my example one would create a form where the nodes have a required trait of name. A command can be executed to determine if all nodes meet this criteria.

I see in the trait manager documentation that there is a code example with required true. This is not at the individual trait level however. Would greatly appreciate the community guidance!

Answers (1)

artfJuly 5, 20200 reactions

What you see in the documentation it's just about the required attribute (eg. <input ... required/>), so nothing blocks the user from storing the template. In your case, you can create a kind of check before storing which queries all the forms and looks for names in all elements, if an element misses the name attribute raises an error

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.