Forums

Adding class to form container

SubCon 04 Jul, 2017
The <form> is wrapped with a container div class="semanticui-body G2-joomla chronoforms index".
I'd like to be able to add classes to it, and maybe remove the unnecessary ones. Fount the code to be in "libraries/cegcore2/layouts/main.php, So there shouldn't be a problem to do it somewhere?
GreyHead 05 Jul, 2017
Hi SubCon,

Not recommended but by all means try it and see if it works for you. You would need to update your edit when you install a new ChronoForms release.

Bob
SubCon 05 Jul, 2017
Oh no, I specifically wanted to see if you have another solution for me. I do not want to edit your core files.
GreyHead 14 Jul, 2017
Hi SubCon,

You could also add classes using JavaScript on Page load - that should work for you.

Bob
Max_admin 15 Jul, 2017
Hi SubCon,

Why do you need to edit that one ? you can simply override the CSS if its a must but the styles applied to this div are all needed.

You can change the form class itself under the "Display section" action.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
SubCon 16 Jul, 2017
I know I can give class to the form. But it is usually needed to work with the container. As from container I can get the "child" form, but from the form I cannot get "parent" container. There may be many cases when its handy, for instance having multiple forms on the same website. Especially if you need to manipulate the form to be a responsive column asite of some other content, you need to apply css to the container, and so on... I now understand that you have not included this feature, but you may want to add it in future updates as it does give the necessary control for css designer.
Thanks
Max_admin 21 Jul, 2017
Hi SubCon,

I'm still not clear why applying the classes to the form itself would not work, you can also apply the styles you need to the parent container.

But, if you need an extra parent then you can add a "Custom code" action before the "Display section" with this code:

<div class="your container">

And another after the display action:
</div>

This is not the best solution but should do the job for the special case you have.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.