
ChronoForms recognizes that many Joomla! templates are not strong in their provision of form styling, so it offers some default styling that you can apply (or not) and edit to suit your needs.
It might be helpful to have a form to look at. Try creating a test form using the ChronoForms Wizard to add "one of each" of the main inputs to a new form and then save it.
Each of the five steps here describes a different way to style your forms. You can choose the one (or more) that best meets your needs:
- When you create a form with the Wizard, ChronoForms does three things:
- Adds some
<div>
tags to the form HTML to give basic structure - Adds classes to the
<div>
tags and to the input tags to allow CSS styling - Loads some default CSS that uses the classes to give the form a presentable layout
If you look at the Form HTML created by the Wizard you will see something like this (this is a basic text input):
<div class="form_item"> <div class="form_element cf_textbox"> <label class="cf_label" style="width: 150px;"> Click Me to Edit</label> <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_2" name="text_2" type="text" /> </div> <div class="cfclear"> </div> </div>
There is a wrapper
<div>
with a class ofform_item
. Then, there is a second wrapper around the<label>
and<input>
tags with two classes —form_element
andcf_textbox
.There are the
<label>
and<input>
tags themselves with classes ofcf_label
andcf_inputbox
respectively.And lastly there is an "empty"
<div>
with a class ofcfclear
that is used to end any CSS floats used in styling the previous tags.The coding for other types of input is very similar, and usually the only difference is the class of the input tag and the
<div>
tag wrapped around the label and the input.There is nothing very special about any of this; it provides a basic framework for styling.
Here's what the test form looks like with the default ChronoForms styling:
- Adds some
- To see the effect of the ChronoForms CSS, open the form in the Form Editor. Go to the General tab, open Core/View Form Settings, and change Load Chronoforms CSS/JS Files to No.
Save the form and refresh the front-end view. Here is the same form without the ChronoForms CSS styling loaded. Not so pretty, but still fully functional.
- Chapter 8, Uploading Files from your Forms in particular the Moving a form with CSS section
- W3Schools CSS tutorials and references at http://www.w3schools.com/css/default.asp provide a useful online introduction to CSS