Recent Topics

1 Jul 26, 2006 18:32    

The default Form object outputs some javascript as part of its end_form method. This javascript checks for the addEvent function (defined in functions.js) and if present adds a call to init_dynamicSelect to the window.onload event, but I don't see a definition for init_dynamicSelect anywhere in the source. It normally doesn't run because functions.js isn't included by default.

Now I'm trying to use a plugin to modify the login form by calling some javascript (don't worry, its' degradable) which is also attached to the window onload event. To do so I have to include (via <script src="...">) functions.js, but then that triggers init_dynamicSelect, which isn't defined so gives me an error. Even if I define it as an empty function in part of my own script, it is stealing the event bubble and doesn't let my own function work.

Is it required? Can it be removed?

2 Jul 26, 2006 21:14

init_dynamicSelect is defined in /rsc/js/dynamic_select.js.

I'll change/fix _form.class.php like this:


							if( typeof addEvent == "function" )
							{
								addEvent( window, "load", init_dynamicSelect, false );
[...]


to

							if( typeof addEvent == "function" && typeof init_dynamicSelect == "function" )
[...]

Thanks for pointing it out.

3 Jul 26, 2006 21:25

Thanks for fixing it! :)


Form is loading...