How to get the form to dynamically change its size when showing or hiding fields - confiforms
Asked by Ryan Kafoor:

Hello,

So I have set up some rules to hide some additional fields with a certain condition, however when the fields are hidden the size of the form does not change dynamically (See images below). Is there a way to make the form do this dynamically? This can be problematic, especially if there are fields to be hidden in the middle of the form.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/279681i928ACAAAFD52EDBE/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/279682i13D5ED9D0FEA60EF/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Alex Medved _ConfiForms_
body: Hi [@Ryan Kafoor](/t5/user/viewprofilepage/user-id/5292920)

Consider switching to embedded view for your form. As I understand it is not in a dialog, and the dialog size is calculated for the initial form view and is not resized after

Alex

comments: author: Ryan Kafoor
body: I do have the view as embedded already. But still doesn't resize when the fields hidden.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/279700i1AFE4C06C8288BFC/image-size/large?v=v2&px=999 "image.png")


author: Alex Medved _ConfiForms_
body: Embedded forms resize on hide/show rules - see <http://recordit.co/ceSjdeD9Id>

Alex


author: Ryan Kafoor
body: I understand how it would work, but this is not the behavior that is occurring in my case. Can this be due to the custom layout that I have in the forms view?

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/279956iA3C298CDAA57B2C1/image-size/large?v=v2&px=999 "image.png")


author: Alex Medved _ConfiForms_
body: OK, you have custom layout and in this case ConfiForms does not know what to resize, as each field is given in the own line and paragraph

It can show/hide the field itself... but not the layout you put around the fields

Consider grouping the fields into some kind of containers are managing those via ConfiForms Field Definition Rules to show/hide containers <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-Hidecontainer>

Alex


author: Ryan Kafoor
body: Thanks, but I have no idea how I would be able group the fields into containers as I don't have the permission to create user macros. What would you suggest otherwise in this case? Would I be able to achieve a custom layout somehow without modifying the form view?


author: Alex Medved _ConfiForms_
body: My answer was not about creating user macros...

But about grouping the fields into the "container-like" macro and handling the visibility of it, not the individual fields (taking into account the layout your have)

Alex


author: Ryan Kafoor
body: Could you elaborate on exactly what macro you are suggesting? The example here <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-Hidecontainer> afaik requires an user macro to be defined, which I do not have the permissions to do.


author: Alex Medved _ConfiForms_
body: For example a div macro from [https://marketplace.atlassian.com/apps/247/content-formatting-macros-for-confluence?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/247/content-formatting-macros-for-confluence?hosting=server&tab=overview)

Any macro that creates a container and could be identified via CSS (offers to define an element id or a class)


author: Ryan Kafoor
body: Oh yes...I did see that too. However that also is not installed and I am not sure if I can get it to be installed either. Is there any other way to get around this? Another way I imagine would be to create pages using IFTTT and to display only the relevant fields instead of hiding or showing fields, but I imagine there to be some setting that restricts confiforms to create pages automatically, as it apparently lacks permission to do that.


author: Alex Medved _ConfiForms_
body: Not sure how this IFTTT and page creation is related to the original question... and how this can be restricted.

As I understand the question was about having a custom layout where you can hide/show different parts of the form based on the selections being made by the user when entering data

Alex


author: Ryan Kafoor
body: I was thinking of another method to get the work here done, as I don't have content formatting macro plugin installed. Do you have any other suggestions to get around this problem? Thanks


author: Alex Medved _ConfiForms_
body: Well, with all these restrictions...

Use standard layout for your forms (empty the ConfiForms Registrations Control macro)


author: Ryan Kafoor
body: Mmm...okay. Thank Alex.


Tags: confiforms

confluence-server

server