Forums

Tooltips, Calendar and Verification not working

Romuba 04 Mar, 2010
I have installed Chronoforms and created a form and all worked beautifully... while on my local server. I then made a backup and restored it to my normal server. The entire website worked fine except for these three features on the form.

Calendar - Nothing displayed at all so I couldn't use it.
Tooltips - None showed so it appeared there were none.
Verification - It just didn't work and the form was submitted even without data.

I have attached two images for clarity. The form is not intended for the public so I can't show the live version.

Any ideas where the problem could lie?[attachment=0]Online_Server.png[/attachment][attachment=1]Local_Server.png[/attachment]
GreyHead 04 Mar, 2010
Hi Romuba,

It's 99.9% certain that this is a JavaScript problem. Take a look at the console in a good JavaSCript debugger like FireBug for FireFox.

You should also try viewing the form with &tmpl=component on the end of the URL - this will load it without the template. If the form then functions OK there is a conflict with the scripts in the template.

Bob
Romuba 04 Mar, 2010
When the template was removed I could see the Calendar and the tooltips but the validation still didn't work.

From Firebug I get the following message:
elementExtend is not defined
[Break on this error] elementExtend();setValidation("Chr...ct_callsheet", 0, 1, 0);});</script>
index....emid=65 (line 88)
$("comment-form").addEvent is not a function
[Break on this error] $('comment-form').addEvent('submit', function(e){
k2.js (line 13


I have no idea what to do now.
GreyHead 04 Mar, 2010
Hi Romuba,

Looks like you have a hyphen '-' in an input name. Please replace it with an underscore and see if that helps,

Bob
Romuba 05 Mar, 2010
After diggin around for ages I realised that the file giving the error was k2.js and I didn't really need K2 on this site so I removed it. The error has changed and now is:

elementExtend is not defined
[Break on this error] elementExtend();


This is even more cryptic and I still have no idea what to do.

When I add "&tmpl=component" to the URL the Calendar and tooltips still work correctly but the form submits without validation.
GreyHead 05 Mar, 2010
Hi Romuba,

From memory elementExtend is defined in one of the ChronoForms validation files so it looks as though one of these s not loading or executing correctly. (Some of them are php files that create scripts.)

Bob
Romuba 05 Mar, 2010
Hi Bob

What I still can't understand is why it all works perfectly on my local machine but not live.

The errors have changed to:

elementExtend is not defined
[Break on this error] elementExtend();
index....emid=65 (line 68)
($(filter) || document).getElementsBySelector is not a function
[Break on this error] return false;});return(nocash)?element...}else{temp.push('[@',param[4],']');}}
mootools.js (line 53)


Line 53 in the Mootools.js file is

return false;});return(nocash)?elements:new Elements(elements);}});function $E(selector,filter){return($(filter)||document).getElement(selector);};function $ES(selector,filter){return($(filter)||document).getElementsBySelector(selector);};$$.shared={'regexp':/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,'xpath':{getParam:function(items,context,param,i){var temp=[context.namespaceURI?'xhtml:':'',param[1]];if(param[2])temp.push('[@id="',param[2],'"]');if(param[3])temp.push('[contains(concat(" ", @class, " "), " ',param[3],' ")]');if(param[4]){if(param[5]&¶m[6]){switch(param[5]){case'*=':temp.push('[contains(@',param[4],', "',param[6],'")]');break;case'^=':temp.push('[starts-with(@',param[4],', "',param[6],'")]');break;case'$=':temp.push('[substring(@',param[4],', string-length(@',param[4],') - ',param[6].length,' + 1) = "',param[6],'"]');break;case'=':temp.push('[@',param[4],'="',param[6],'"]');break;case'!=':temp.push('[@',param[4],'!="',param[6],'"]');}}else{temp.push('[@',param[4],']');}} 


I have looked and I cannot select anything other than Mootools in the configuration screen.

I have made the page visible:
http://www.joshuawest.co.za/files/index.php?option=com_chronocontact&Itemid=65
GreyHead 05 Mar, 2010
Hi Romuba,

elementExtend() is defined in com_chronocontact/js/jsvalidation2.js. Can you check that this is loading correctly?

Bob
Romuba 05 Mar, 2010
For some a dumb question but not for me🙂 How do I check that it is loading let alone correctly?
Romuba 08 Mar, 2010
No further help on this issue yet? I really need to get this problem solved but as yet have no clue what to do.
nml375 08 Mar, 2010
Hi,
I checked the site briefly, the link to the jsvalidation2.js script points here: http://www.joshuawest.co.za/files/components/com_chronocontact/js/jsvalidation2.js
That, however, results in a 404 Not Found page. Actually, now that I check the containing directory, I think I've posted about this in a different thread of yours not too far back in time.. http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=17130&p=47069#p47118

Basically, the jsvalidation2.js script has been renamed into jsvalidation2_old.js, and is thus not loaded.

/Fredrik
Romuba 08 Mar, 2010
In that thread I had started following some advice but I can't remember what happened. I have renamed the file but still no change to the form.
nml375 08 Mar, 2010
Hi,
That sorted the issue with elementExtend. The second error is apparently due to jQuery and MooTools being loaded at the same time. In your case, I suspect it's the second instance of the JQuery library loaded that overrides the jquery.noconflict() mode (from http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js). It would seem that second one is hardcoded into your template, as viewing your form with ja_purity works just fine:
http://www.joshuawest.co.za/files/index.php?option=com_chronocontact&Itemid=65&template=ja_purity

See if you can't edit your template to not include the second jquery-library from googleapis, you won't need it as jquery is already loaded from the scjquery-plugin..

/Fredrik
Romuba 09 Mar, 2010
You are a star!! I removed the second loading instance of jquery and all works beautifully.

Thank you again for taking the time to help. Much appreciated.
This topic is locked and no more replies can be posted.