Require trait, check status
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 attribut...
Read full answer below ↓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)
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 miss...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3512
Child elements not draggable ,droppable highlightable. also the CSS of all child elements not pushed in style section while develop a banner component in as plugin
Hello @artf , I am trying to develop a simple banner plugin which will be include a heading , subheading and link. and every element can be...
Issue #5148
none of the official GrapesJS plugins works with the new index.d.ts
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? all and none, the bug is during the build...
Issue #3287
Wrapper styling
First of all, congrats @artf for this amazing project 💯 I am currently working on a project and I wanted to ask if I can edit the wrapper...
Issue #3399
Convert JSON to HTML server-side
So first of all, thank you @artf for this amazing project. I have a question: Is it possible to easily convert the components-JSON to HTML...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.