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
assigns both buttons Button 2's JS while . . .
assigns both buttons Button 1's JS. ie the order of the dispatchEvent calls changes its behaviour.
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');');
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');');
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