Javascript events not working?

Status
Not open for further replies.

babsgosgens

New Member
Hi all!

Help! I don't get it, if javascript is parsed on the client side, then why do none of my js events get executed? It must be something to do with the server, as averything is working a-ok on my test server, but when I upload the site to the server, they just don't get executed anymore.

Not even the simple alert('alert'); that I attached to a field gets executed! :'( What can be going on here? If anyone has a clue, please help!

Thanks, Babs
 
There could well be some broken or conflicting JS used by components on your live server you don't have installed on your test server, which are hurting the Fabrik JS.

Do you have FireBug loaded in FireFox? If not, load it up:

https://addons.mozilla.org/en-US/firefox/addon/1843

It will automatically warn you if there are any JS errors on a page.

Or point me at the live site (PM me if you don't want to publish the URL here), and I'll take a look.

-- hugh
 
I am also facing the same problem and tearing my hair out trying to figure how the javascript action can be applied to the elements. Command as simple as alert('Help'); not working. Not sure if there is a bug or I missed something. Also there is not Javascripting references for fabrik and can only find pieces of info here and there in this forum. Pls help.
 
I just found a little teensy weensy bugette (or "undocumented feature" as we used to call them in DoD contracting work, as 'bug' was a dirty word).

Basically, in the current SVN (I don't know about earlier versions), you can't save any JS with a quote in it. The code carefully changes any " into ', but then wraps single quotes around the JS code to write it to the db ... so the query breaks, because of the premature termination of the single quoted string.

I've fixed this, but haven't committed the changes to SVN yet as I'm half way through working on another feature (an option to align checkboxes and radio buttons vertically as well as horizontally).

I'll try and get it committed to SVN tonight.

-- hugh
 
Thanks Hugh - you sound good in this work for a musician. Hope to get my hands on your SVN soon.

I hope to get more file.js or template function call references for Fabrik. The only thread I can find is this http://fabrikar.com/index.php?option=com_smf&Itemid=9&topic=505.msg4851#msg4851 for function calls. I have tried it but still couldn't get it to work - using 1.0.4 have applied the latest SVN. Could this be another 'undocumented feature' that need improvement or am I just not doing it right? I struggle with lack of js documentation.

Need expert advice on the file.js function calls.
 
I need desperate help on this too. I have tried all sorts of javascript examples given throughout the forum, but haven't had any luck with any of them. I have tried the first_name plus last_name to get the fullname. I have tried the quantity, total example- but I can't get any of them to work. It probably just has something to do with the elements that I am not doing right. Can someone give me a step by step example of just the simplest javascript using elements, so I can see if Fabrik is working correctly.
Thanks.
 
3Darth said:
I need desperate help on this too. I have tried all sorts of javascript examples given throughout the forum, but haven't had any luck with any of them. I have tried the first_name plus last_name to get the fullname. I have tried the quantity, total example- but I can't get any of them to work. It probably just has something to do with the elements that I am not doing right. Can someone give me a step by step example of just the simplest javascript using elements, so I can see if Fabrik is working correctly.
Thanks.

Well the ones you have tried should work. So its likely you may have some JavaScript problems elsewhere on the page causing knockon effects.

If you view the page with FireFox with FireBug enabled, do you see errors when you load the page?

-- hugh
 
I do have this error that shows up:

oEl.element has no properties
addElement(Object options=Object)form.js (line 13)
(no name)()index.php (line 244)
returns()mootools.js (line 21)
create(undefined)mootools.js (line 21)
e(function())mootools.r598.js (line 3)
e("domready", undefined, undefined)mootools.r598.js (line 3)
domReady()mootools.js (line 56)
returns()mootools.js (line 21)
create(DOMContentLoaded )mootools.js (line 21)
[Break on this error] elId = oEl.element.id.replace('[]', '');
form.js (line 13)
 
update from the SVN, the files you have are not up to date.

In components/com_fabrik/views/form/form.js

Code:
	addElement: function( oEl ){
		elId = oEl.element.id.replace('[]', '');
		this.elements.set(elId, oEl);
	},

has been replaced with

Code:
	addElement: function( oEl ){
		if(oEl.element){
			elId = oEl.element.id.replace('[]', '');
			this.elements.set(elId, oEl);
		}
	},
 
Try changing the code in your firstname and lastname elements 'onblur' events to just say:

fillAppName();

... which should call the function you have in 1.js, which looks OK. The code you currently have in the element JS won't work.

Also, take the code in the 'quantity' element, wrap it in a function and put that in your 1.js file, and just call that function from the 'quantity' element JS.

It's always best to function-ize this stuff, then you can put break points in the function with FireBug, and see whats going on.

-- hugh
 
The issue is that each occurance of these lines:

Code:
var el = new fbField('', {});
ofabrik.addElement(el);

should be something like

Code:
var el = new fbField('jos_fabrik_formdata_1___firstname', {});
ofabrik.addElement(el);

but i dont see why this isnt happening and/or be able to replicate it.

Id suggest backing up fabrik files, deleting them from your server and reuploading fresh ones taken from the SVN.

Rob
 
I updated, totally reinstalled, Fabrik using the svn files. Still the same problem, and I see the same code that you were talking about. What am I not doing right? Does anyone have a page that they can show me how this is supposed to work?
thanks for the continued help. I am using joomla version 1.012, is this the problem?
 
Well the way you are doing it should work.

To debug this one, I'm going to need an amdin login on your site. If you want me to do this, PM me.

-- hugh
 
I have loaded up an entire new site with Joomla 1.0.13, Fabrik 1.0.4b and all the latest SVN, but still could not get elements javascript working. I seem to be getting the following problems in the admin pages at some point

IE6 - cannot save forms with javascript errors
Firefox/firebug - cannot save elements with errors

If someone can help check the modified sample Contact Us form http://neurotekonline.net/forms/index.php?option=com_fabrik&Itemid=2

Also something wrong with the admin pages and don't mind giving the password to it, http://neurotekonline.net/forms/administrator - Username = admin, Password = password3

This is the 3rd time installing from scratch. The elements javascript just doesn't seem to work at all. It all just seem so hard to get working as it supposed to. Can someone help??
 
I'm working on this one.

I can see whats happening, but not why. I can't duplicate it on my test sites.

No point reinstalling again, this seems to be some kind of systemic problem with certain sites. Rob and I are working on it as I type.

-- hugh
 
Status
Not open for further replies.
Back
Top