Setting values of hidden fields
Question
I have an issue with hidden fields inside a form element, I want to select the form in the editor and then change the values of the hidden fields by clicking on select boxes. I've added the select boxes to a new panel. How do I find the hidden fields within the selected form component and then set their values? The hidden fields are not direct children of the form. I'm interested in discussing best practice solution to this problem. It might be the case that the values need to be set when the form is added. Thanks
Answers (3)
Great stuff, grapesjs is amazing btw
Hi Michael, you might want to rely on Component's view for this purpose Probably I'll add find(query) into Component in the next release
Thanks @artf this is what I ended up with This kind of repeats itself a bit, because each hidden field is picked up in the foreach, but the $el variable holds all of the hidden fields, which is why added the returns to break the loops. Would be interested to know if there was a more elegant way of...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1951
[QUESTIONS] change or add event on add component from block
is it possible ?, change the drag and drop event to on click when adding a new component, I want to add components by clicking the block th...
Issue #1576
Select element that has several blocks as one unit.
I've created new block (like form or dialog, etc) that has several blocks such as search box, button, text fields, ... This element doesn't...
Issue #1811
changesCount change on clicking any element in editor
Hello, I have used changesCount to resizeEditor if any change occurs to the canvas. But when I select any element in canvas like, clicking...
Issue #2003
[Question] How to select a specific element nested inside a template
My test case: https://codepen.io/jogai/pen/QRjKyN?editors=1111 I want to select the middle column so I thought I can use selectorManager.ge...
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 →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.