Hey,
This is a follow-on I guess from this thread: http://www.silverstripe.org/archive/show/1406#post1406 . Basically, there's a lump of JavaScript appearing towards the end of my page code which is preventing anything like light-whatever or JQuery from functioning. It's as follows:
<script type="text/javascript" src="http://mysite/jsparty/prototype.js?m=1226464322"></script><script type="text/javascript" src="http://mysite/jsparty/behaviour.js?m=1228253400"></script><script type="text/javascript" src="http://mysite/jsparty/prototype_improvements.js?m=1195165918"></script><script type="text/javascript" src="http://mysite/sapphire/javascript/i18n.js?m=1236311236"></script><script type="text/javascript" src="http://mysite/sapphire/javascript/lang/en_US.js?m=1229303948"></script><script type="text/javascript" src="http://mysite/sapphire/javascript/Validator.js?m=1236311236"></script><script type="text/javascript">//<![CDATA[
Behaviour.register({
'#SearchForm_SearchForm': {
validate : function(fromAnOnBlur) {
initialiseForm(this, fromAnOnBlur);
var error = hasHadFormError();
if(!error && fromAnOnBlur) clearErrorMessage(fromAnOnBlur);
return !error;
},
onsubmit : function() {
if(typeof this.bypassValidation == 'undefined' || !this.bypassValidation) return this.validate();
}
},
'#SearchForm_SearchForm input' : {
initialise: function() {
if(!this.old_onblur) this.old_onblur = function() { return true; }
if(!this.old_onfocus) this.old_onfocus = function() { return true; }
},
onblur : function() {
if(this.old_onblur()) {
// Don't perform instant validation for CalendarDateField fields; it creates usability wierdness.
if(this.parentNode.className.indexOf('calendardate') == -1 || this.value) {
return $('SearchForm_SearchForm').validate(this);
} else {
return true;
}
}
}
},
'#SearchForm_SearchForm select' : {
initialise: function() {
if(!this.old_onblur) this.old_onblur = function() { return true; }
},
onblur : function() {
if(this.old_onblur()) {
return $('SearchForm_SearchForm').validate(this);
}
}
}
});
//]]></script>
I figure it's probably quite necessary for some pages, like pages with comments on, but it appears for any and every page, regardless of whether the comments system is switched on or not. It even pops up when the "$PageComments" is removed from the template. Is there any way to make this a little more targeted, so it only gets included where it's needed?
Any ideas would be greatly appreciated.
Cheers,
Alex