Mike-it Posted January 14, 2021 Share Posted January 14, 2021 I have a script that generates a bunch of inputfields and then outputs a form. I am trying to group visually these things. Basically, I'd like the output to have the fields grouped by some <div>s. I know I can use fieldsets for this, but in this case I can't, because the form is used by other functions (Padloper's) that assume it has a flat structure (no nested fields). So I need a way to inject some extra markup into a flat list of fields. I thought about using an After hook to InputField::render to inject the extra <div>s and </div>s that I need, but it does not work, because while I can indeed inject some markup this way, it is still wrapped by the code that usually wraps the element, i.e. <div class="InputField..."ecc>, so there is no way to output markup that act as a container of several fields. Finally, using the setMarkup method of the form allows me to control the rendering of the fields, but it seems that it works on all fields or nothing. I haven' been able to change it just for a single field of the form. Any idea or suggestion? Thanks Link to comment Share on other sites More sharing options...
3fingers Posted January 14, 2021 Share Posted January 14, 2021 Is it javascript an option? Link to comment Share on other sites More sharing options...
Mike-it Posted January 14, 2021 Author Share Posted January 14, 2021 9 minutes ago, 3fingers said: Is it javascript an option? That is actually my plan B: modifying the DOM after the fact, client-side. But I still would like to know if there is a way to do this in PW. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now