Button calls wrong Javascript

PtrNrs

Member
As shown in this video, when I construct a simple form with two buttons, B1 & B2, the first listed B1 runs B2's Javascript and B2's JS is OK. Swap the buttons (B2 then B1) and B2 runs B1's JS.

This is behaviour somewhat intermittent - when I first constructed the form on Mac MAMP, it performed correctly and then reverted to the above behaviour for no reason I could determine.

I have also seen a button try to execute the JS assigned to a dropbox in the same form.

The HTML looks OK, but I suspect the JS function dispatchEvent() because
Code:
Fabrik.blocks['form_140'].dispatchEvent('button', 'ztest_buttons___Button1', 'click', 'alert('Button 1');');
Fabrik.blocks['form_140'].dispatchEvent('button', 'ztest_buttons___Button2', 'click', 'alert('Button 2');');
assigns both buttons Button 2's JS while . . .
Code:
Fabrik.blocks['form_140'].dispatchEvent('button', 'ztest_buttons___Button2', 'click', 'alert('Button 2');');
Fabrik.blocks['form_140'].dispatchEvent('button', 'ztest_buttons___Button1', 'click', 'alert('Button 1');');
assigns both buttons Button 1's JS. ie the order of the dispatchEvent calls changes its behaviour.
Code:
Configuration:
Browser: Firefox & Chrome both on LAMP website and Mac MAMP.
Fabrik version: Latest F3.0.x from Github
PHP Built On    Linux dse-vmzic536.vde.net.au 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed Jun 12 03:34:52 UTC 2013 x86_64
Database Version    5.5.32-cll
Database Collation    utf8_general_ci
PHP Version    5.3.26
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 2.5.11 Stable [ Ember ] 26-April-2013 14:00 GMT
Joomla! Platform Version    Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT
User Agent    Mozilla/5.0 (Windows NT 6.0; rv:22.0) Gecko/20100101 Firefox/22.0
 
No! This problem is both intermittent and browser dependent.

Yessterday when I loaded the latest Fabrik, the problem stopped and I assumed that it was a temporary bug in that version of Fabrik. So, I closed this thread - now reopened.

Today the problem has reappeared in Chrome & Firefox but not (!) in IE9.

I cleared the Joomla cache (I had already cleared the browser cache several times) and after a while the problem disappeared in Chrome and then in Firefox as well. The delay was long enough to make me doubt a causal connection.

So right at the moment everything is OK. Is there anything I should test if this reappears. Could the Joomla cache cause such problems with the Fabrik event handler? How can I be confident that the problem will not reappear?
 
perhaps a browser cache issue? I'm really not sure - it works consistently for me
 
It's been driving me mad for several weeks and now (fingers crossed) it's been working for me all day too.

Rest assured I'll let you know if it reappears.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top