CFv4 Elements and HTML

How do I load MooTools in Joomla! 3?

In Joomla! 3 the MooTools JavaScript library is deprecated in favour of JQuery. However ChronoForms v4 still uses MooTools for most of the JavaScript functions. You can still load MooTools where you need it.

How can I disable options in a select drop-down?

The request was for a form for a college site where a course had several options each of which had a limited number of places. Once all the places were taken for one option that should still show in the dropdown but be disabled.

What are containers and how can I use them?

It you've used ChronoForms for a little while you may have noticed that in the Advanced elements group there is a ‘Container’ element that seems a little bit different. It a very useful element when you build large or complex forms and this FAQ is an introduction to using it.

My 'event' input won't save or email?

If you have an input in your form named 'event' or 'option' or 'task' or 'chronoform' then you may not get the results that you expect.

How can I include files or code in a ChronoForm?

If you are using code that is repeated on several forms; or writing long or complex code; or you need to include files from a third party API then it can be really useful to include those files into your form instead of trying to work in the ChronoForms textareas.

How can I add a simple Double Drop-Down without Ajax?

User pixelhexe wrote: I had to "fight" with the same problem to build a Simple Double Dropdown without Ajax (ChronoForms V4 RC3.0). Finally I've solved it this way, maybe it helps others to better understand the process.

How can I add a password stength check?

Internet users are famous for using the simplest possible passwords and using the same password on many sites. In some cases that is unimportant but if you have any sensitive or valuable material on your site you may want to ensure that user passwords are at least reasonably secure. This FAQ shows you how to add a strength checker to a password input.

How can I add an attribute to a form input?

Attributes are extra "values" that are added inside a from input tag like data='xxx' or readonly='readonly'. ChronoForms doesn't provide an input box where you can add these directly but using the JavaScript from this FAQ you may be able to add them by using the ChronoForms 'Class' box.

Can I use Bootstrap with ChronoForms?

In Joomla! 3.0 the BootStrap development framework was added to the code base. BootStrap includes CSS for form formatting that give good looking results but it requires some HTML structures and classes that ChronoForms does not use. This FAQ includes a JavaScript snippet that can be applied to a form to use some parts of BootStrap.

How do I use the Multi File Upload widget?

The Multi File Upload Widget allows you to upload more than one file from the form in the same element. Here's how to set it up:
 

How can I get my form signed?

A client requested a form that could be signed. They were using it to conduct household surveys and wanted to record the form details with a facsimile signature of the householder (and the interviewer in the actual application). The only code that I could find to do this was 'Signature Pad', a jQuery plug-in. This FAQ gives and overview of using the plug-in with ChronoForms.

How can I use 'star ratings' in my form?

If you are creating rating forms then it can look better and be simpler to use if you show the user a row of stars to check instead of a drop-down or a radio button group. This FAQ shows you one way to do this.

How can I ask new users for information and not ask logged in users?

If you have a form that needs contact information like name and email then this is already saved in the User data for registered users. It can be useful to show this saved information if the user is logged in but still ask new users to complete the form inputs. This FAQ shows a way to do this.

My form inputs are too wide

There are two situtations where form inputs look too wide. One is when the form is in a narrow module and the default ChronoForms setting is too big; the other in a full page when the template CSS over-rides the ChronoForms setting.

How can I show data linked to a drop-down option?

A user wanted to be able to display a serial number associated with some of the options in a large select drop down element. The request was to display the number if there was one, otherwise to hide the field. While this is an uncommon request the code is posted here because it could be adapted to meet various similar needs.

How can I build a tabbed form?

Long forms can be difficult for the user to work though and can look very complicated on the page. It can be very useful to break them up into smaller pieces. This tutorial is about splitting the form across several tabs. (There is another tutorial about building a multi-page form.)

How can I add a colour picker to my form?

If you need your users to be able to select colours then adding a colour picker which shows them a range of coloured swatches to choose from can be helpful. This FAQ uses one particular MooTools based picker but could be adapted to other similar pickers.

Why can't I see my form?

If you are new to ChronoForms and start using the Form Wizard sometimes all you can see when you view your form is is the ChronoForms strap-line, or maybe an empty page. Here's the answer.

How can I style the Reset and Back buttons?

You can add a Class attribute to the Submit button but this is not applied to the Reset and Back buttons if they are enabled (in CFv4 RC3.5). You can add classes with a couple of lines of Javascript:

How can I show/hide a textarea when a checkbox is clicked?

Here's an example of a script to hide a textarea or a text input based on a checkbox setting.