Forums

Problem: suddenly "Required" does not work

petermazzi 24 Feb, 2011
I do not know what happened, but the "Required" does not work anymore on forms where it used to work until yesterday.
People can now send the form without filling fields that request an input. The HTML has not changed and is still ok...
Please help me as I am receiving forms with incomplete information....
GreyHead 24 Feb, 2011
Hi petermazzi,

Sounds like a JavaScript conflict. Nothing changed in ChronoForms so I guess something else changed on your site.

Did you upgrade Joomla!? If so please check that the MooTools Upgrade plug-in is disabled.

Bob
petermazzi 24 Feb, 2011
hi, i didn't upgrade joomla recently, mootols upgrade plugin is disabled, joomla version is 1.5.22, we got the following error:

[23-feb-2011 04:53:18] PHP Parse error: syntax error, unexpected T_STRING in /public_html/components/com_chronocontact/chronocontact.html.php(184) : eval()'d code on line 5

in chronocontact.html.php line 184 is :

$MyForm->formrow->html = str_replace('{imageverification}',$imver,$MyForm->formrow->html);
eval( "?>".$MyForm->formrow->html );

PLEASE HELP
GreyHead 24 Feb, 2011
Hi petermazzi,

Please post the first 10 lines or so of your Form HTML the problem is on line 5.

Bob
petermazzi 24 Feb, 2011
Do you mean the first 10 lines of the file chronocontact.html.php not of the Form...right ?

<?php
/*
/**
* CHRONOFORMS version 3.1 
* Copyright (c) 2008 Chrono_Man, ChronoEngine.com. All rights reserved.
* Author: Chrono_Man (ChronoEngine.com)
* @license		GNU/GPL
* See readme.html.
* Visit http://www.ChronoEngine.com for regular update and information.
**/

/* ensuring that this file is called up from another file */
defined('_JEXEC') or die('Restricted access');
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();

class HTML_ChronoContact {
// Procedure for building the table
function showform( $row, $posted ) {
 	global $mainframe;
	$database =& JFactory::getDBO();
	$MyForm =& CFChronoForm::getInstance($row->name);
	$CF_PATH = ($mainframe->isSite()) ? JURI::Base() : $mainframe->getSiteURL();
	$uri =& JFactory::getURI();
	if($uri->isSSL()){
		$CF_PATH = str_replace('http:', 'https:', $CF_PATH);
	}
	if((!empty($MyForm->formrow->name))&&($MyForm->formrow->published)){
		?>
		<?php if (($MyForm->formparams('LoadFiles') == 'Yes')||( trim($MyForm->formparams('validate')) == 'Yes')||($MyForm->formparams('captcha_dataload'))){ ?>	
			<?php JHTML::_('behavior.mootools'); ?>
        <?php } ?>
        <?php ob_start(); ?>
GreyHead 24 Feb, 2011
Hi petermazzi,

No absolutely not. I mean that you open the Form Editor by clicking the Form Name link in the ChronoForms Forms Manager; click the Forn Code tab, then the [+/-] sign by the Form HTML label and copy the first ten lines of the Form HTML.

Bob
petermazzi 24 Feb, 2011
Ah ok, please consider I have almost 20 active forms with the same problem. I put the html code of one:
<div class="form_item">
  <div class="form_element cf_heading">
    <h4 class="cf_text">xxx</h4>
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">First Name</label>
    <input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_7" name="text_7" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Last Name</label>
    <input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_8" name="text_8" type="text" />
GreyHead 24 Feb, 2011
Hi petermazzi,

That looks OK. I don't think that's will give rise to the error you posted.

Are all the errors identical?

Is this from the form giving the error you posted?

Bob
petermazzi 24 Feb, 2011
All forms worked fine yesterday, also now they work ok, but the "Required" function does not work anymore on all forms of my website... so I am receiving uncomplete forms as it is not anymore compulsory to fill all fields... Any clue ?
GreyHead 24 Feb, 2011
Hi petermazzi,

I think we've been here before:

Sounds like a JavaScript conflict. Nothing changed in ChronoForms so I guess something else changed on your site.



Bob
petermazzi 24 Feb, 2011
Do not know why but now the forms seem to work again asking for the "Required" fields...I really cannot explain it !!! BTW: good that the problem is solved and hope it will not return...Thanks for your time...
GreyHead 24 Feb, 2011
Hi petermazzi,

Maybe something stuck in a cache that cleared out over time??

Glad to hear it's working again.

Bob
aleorco 02 Mar, 2011
I GreyHead, I've the same problem on my site: the "Required" does not work anymore on form.
When I create the form it worked fine, but suddenly it doesn't. So I try to export it and upload on another site with Chronoforms and it works fine.
I've installed the following extensions: Artio JoomSEF, SwMenuPro, JCE Editor

The site is: http://www.psicoeuropa.it clic on REGISTRATI to see the issue

Got any idea?
Joomla v1.5.22
Chronoforms v3.2

If you need, I send the a superadmin account.

Thank you in advance.

Alex
GreyHead 02 Mar, 2011
Hi Alex,

The form without the template has the validation working OK.

Your template (or some other component) is loading the jQuery JavaScript library. Out of the box jQuery isn't compatible with the MooTools library used by Joomla! and ChronoForms. You can use jQuery with MooTools in no-conflict mode. There are various ways of doing this. The simplest is to add a line of script in the ChronoForms Form JavaScript box:
jQuery.noConflict();
This will free the $ operator which is used by MooTools, so you may need to update your own javascripts to use the longer jQuery operator.

There is also a neat Joomla! system plugin named SC jQuery that allows you to control on which pages jQuery is loaded, and will always load it in no-conflict mode.

Bob
aleorco 02 Mar, 2011
Hi GrayHead,
thanks for your quick response. I added the line jQuery.noConflict();
in Form Code => Form JavaScript and save it
Then I open the form, but nothing changes: "required" still not working
GreyHead 02 Mar, 2011
Hi Alex,

True, actually it's already there twice. It looks to me as though the ChronoForms version is being loaded before the JQuery library is loaded and the others may be too late to help avoid the problems with the validation.

I'm afraid that you will need to do some careful JavaScript debugging to sort out the problems. Unfortunately this is often the case when you use modules or templates that aren't very Joomla! friendly. In this case I think that the swmenupro module may be the culprit.

Bob
aleorco 02 Mar, 2011
Hi GreyHead,
the culprit is not swmenu: in another site it works perfectly with the "required" fields.

I have another two extensions in the site <!-- w --><a class="postlink" href="http://www.psicoeuropa.it">www.psicoeuropa.it</a><!-- w --> :
Ultimate Content Display
Enhanced Weblinks

I've found the culprit: Ultimate Content Display and his JQUERY CROSS FADER/SLIDER SETTINGS !!!!

Thanks for your suggestions on the cause of the problem.

Alexx
GreyHead 02 Mar, 2011
Hi Alex,

Well found! and my apologies to swMenuPro

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