Forums

How to define a form container

NickOg 30 Jul, 2012
Hmm! Not a good day! I want to use the same css file for two similar forms. I should be able to do it by embedding all of the css under the id of the form (#chronoform_somename01,#chronoform_somename02) I know but I thought that I would simplify things by defining a class for each form and use that class as the common container (form.clsSomeName #xxx). But I can't work out how to add a class to a form.

I thought that I could use the 'Form tag attachment' but while that will add a tag ('fred' or whatever) it won't add an additional class tag.

I thought that I would add a header at the top and bottom of the form with <div class='someclass'> at the top and </div> at the bottom. That has really stuffed things up. The whole form has become embedded in one of the header boxes and I can no longer see the Events that I have defined. and if I delete the header it deletes the whole form contant!

Then I thought I would embed the whole form in a container and I can use that to define and id or a class for the form. But since I am embedding classes within classes that hung my server every time I saved the form. Well, to be precise, took several minutes to save the form.)

So, the question is, how is the best way to do that? Add some custom code at the top and bottom of the form - line the 'container' option that I tried? That is <div class='someclass'> at the top and </div> at the bottom.

Regards Nick
GreyHead 30 Jul, 2012
Hi Nick,

You can use the new Container elements to add a div round all or part of the form, though this would require a re-build for an exiting form as you can't drag and drop elements into a container.

The Header elements do seem to cause problems particularly if you use double quotes in them "" - single quotes are usually OK.

I use Custom Element elements from the Advanced group most of the time. Click the Code checkbox and you can easily add <div class='xxx'> and <div> tags to your form and drag them to the places you want them.

Bob
NickOg 30 Jul, 2012
Thanks Bob (sorry about my awful typing in the title)

Is there some limit to depth of container nesting? I did rebuild the form in a container but that was when the thing went off into the weeds for some minutes?

I will try using custom elements around the form tomorrow. Must remember the code check box.

Nick
GreyHead 30 Jul, 2012
Hi Nick,

Theoretically, probably not, but each layer adds a it more complexity to the code so I'd keep it as low as practical.

Bob
This topic is locked and no more replies can be posted.