02 Feb 2012

Solve Chronoforms getInputByName2 error

Escrito por  Roberto Segura

When running Chronoforms v.3.2 on a Joomla 1.5 site with Mootools Upgrade Plugin installed and enabled you can get Javascript errors like:

 XXXXX.getInputByName2 is not a function

It's caused by a method defined in Chronoforms javascript validation. The Mootools Upgrade Plugin replaces the Mootools version 1.12 with Mootools 1.2.5 and that causes that the method getInputByName2 defined in Chronoforms stops working.

There are two methods to solve the problem:

  • Update chronoforms to v.4 and create from scratch all your forms
  • Edit the chronoforms component to solve the problem


As the v4.0 version can be installed side by side with the old v.3.2 version you can combine both solutions. So you can solve manually the compatibility error and then do the form migration slowly.

Edit the Chronoforms component to solve the problem.

Edit the file:

components/com_chronocontact/libraries/includes/JSvalidation.php

and search:

Element.extend({
        getInputByName2 : function(nome) {
            el = this.getFormElements().filterByAttribute('name','=',nome)
            return (el)?(el.length)?el:el:false;
        }
    });

Replace it with:

Element.implement({
        getInputByName2 : function(nome) {
            el = this.getFormElements().filterByAttribute('name','=',nome)
            return (el)?(el.length)?el:el:false;
        }
    });

This changes the method definition to make it compatible with Mootools 1.2.5+

Leave a comment

Los campos marcados con (*) son obligatorios.

Domatix Technologies, S.L.U. - C/Espinosa 8 - 46008 - Valencia - Telf.: 963 230 962
Delegación Murcia - C/Juan de Juanes 4 - 30740 - San Pedro del Pinatar - Murcia