Forums

JS Validation not working for me

murrieta 30 Mar, 2010
Hi,

I've created several sites that use Chronoforms, with great results. However, on this particular one, the client side validation does not work. It is hosted on the same provider as others so I rule that out.
I've read several posts regarding client side validation, and I believe the problem is not related to mootols conflicts. I tested it by disabling almost all modules (including the menu and the googlemaps module) with no results.

Here's a link to the form:
http://www.ecuapack.com/site/index.php?option=com_content&view=article&id=49&Itemid=65

Here's the form code:
<table width="309" border="0" align="left" cellpadding="2" cellspacing="1">
    <tr>
      <td height="23" colspan="2"><br /></td>
    </tr>
    <tr>
      <td><div align="right">Nombre </div></td>
      <td height="23"><label>
        <input type="text" name="nombre" id="nombre" />
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Apellido</div></td>
      <td height="23"><label>
        <input type="text" name="apellido" id="apellido" />
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Compañía</div></td>
      <td height="23"><label>
        <input type="text" name="compania" id="compania" />
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Ciudad</div></td>
      <td height="11"><input type="text" name="ciudad" id="ciudad" /></td>
    </tr>
    <tr>
      <td align="right">E-mail</td>
      <td height="11"><input type="text" name="email" id="email" /></td>
    </tr>
    <tr>
      <td><div align="right">Teléfono</div></td>
      <td height="23"><input type="text" name="telefono" id="telefono" /></td>
    </tr>
    <tr>
      <td valign="top"><div align="right">Comentarios</div></td>
      <td height="73"><textarea name="comentarios" cols="30" rows="4" id="comentarios"></textarea></td>
    </tr>
    <tr>
      <td width="78" valign="top"> </td>
      <td width="220" height="46" valign="top"><label>
      <input type="image" name="imageField" id="imageField" src="images/btn_enviar.jpg" />
      </label></td>
    </tr>
  </table>


On the form configuration, I have set:
Load Chronoforms CSS/JS Files? YES
on the tab 'validation', Javascript live validation, enable validation YES

I've also tried creating a test form, but neither the client side nor the server side validation seem to work.

I'm running CF 3.1 RC 5.5, and I'm out of ideas, any advise?
GreyHead 31 Mar, 2010
Hi murrieta,

There is no client-side (JavScript LiveValidation) set on the form. There need to be classes set fot the inputs e.g. class='required' to tell ChronoForms what validation is required. There are none showing in the form HTML.

Server-side validation requires that you add PHP into the server-side validation box to carry out the checks? Do you have any? and, if so, what is the code?

Bob
murrieta 05 Apr, 2010
Hi Greyhead,
Thanks for your advise, for some reason Joomla wasn't loading the proper JS code. Also, My HTML code lacked the required classes.
I uninstalled the component and the plugin, and reinstalled again. This solved the issue.

I believe the cause was an upgrade form an earlier RC Chronoforms install, without first uninstalling.
Thank you very much for your time.

Rodolfo
GreyHead 06 Apr, 2010
Hi Rodolfo,

Ah OK. When you upgrade it is important to clear the browser cache as sometimes old script are stored there. (I usually forget until things don't work correctly.)

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