You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by es <es...@javanet.info> on 2006/05/26 20:28:19 UTC

problems with js and cforms

Hello all,
I've problems getting my cform js working: the calendar field for 
example doesn't pop up, fields doesn't react to on-value-changed etc.
I've checked the head is ok, same as the examples output.
The problem is probably on the onload event. I have the need to init 
some custom js in my page and I've overrided 
window.onload=function(){...} with my function. Loading the page the js 
debugger gives me
Error: forms_onloadHandlers[i].forms_onload is not a function Source 
file: http://localhost:9999/01/resources/forms/js/forms-lib.js
on clicking the calendar I got
Error: forms_getForm(this) has no properties
if I comment out the my own onload() the first error on loading doesn't 
happens anymore but I still get the later when I click the calendar img. 
So it's probably two separate problem.
any advices? I'm a bit lost after a day trying to solve the problem and 
no related messages on this ml ... at least I didn't found... Tell me if 
you need further details. (cocoon 2.1.9)
TIA
Eli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


[solved] Re: problems with js and cforms

Posted by es <es...@javanet.info>.
> I still have issue calling my window.onload() what's the correct way to 
> initialize my javascript on loading?

To correctly initialize onload() I had to add these lines:
if (window["forms_onloadHandlers"] == undefined) {
	window.onload = function()	{
     	if (window.winOnLoad) winOnLoad();
     	}
} else {
	var myinit = new Object();
	myinit.forms_onload = function() { winOnLoad();}
	forms_onloadHandlers.push(myinit);
}

hope this helps others...
Eli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: problems with js and cforms

Posted by es <es...@javanet.info>.
I've found what was causing the problem is stripnamespaces.xsl. However 
now I have a page that display but doesn't validate as xhtml1.1.

I still have issue calling my window.onload() what's the correct way to 
initialize my javascript on loading?

thanks
Eli

es wrote:
> Hello all,
> I've problems getting my cform js working: the calendar field for 
> example doesn't pop up, fields doesn't react to on-value-changed etc.
> I've checked the head is ok, same as the examples output.
> The problem is probably on the onload event. I have the need to init 
> some custom js in my page and I've overrided 
> window.onload=function(){...} with my function. Loading the page the js 
> debugger gives me
> Error: forms_onloadHandlers[i].forms_onload is not a function Source 
> file: http://localhost:9999/01/resources/forms/js/forms-lib.js
> on clicking the calendar I got
> Error: forms_getForm(this) has no properties
> if I comment out the my own onload() the first error on loading doesn't 
> happens anymore but I still get the later when I click the calendar img. 
> So it's probably two separate problem.
> any advices? I'm a bit lost after a day trying to solve the problem and 
> no related messages on this ml ... at least I didn't found... Tell me if 
> you need further details. (cocoon 2.1.9)
> TIA
> Eli
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org