Stumped on seemingly simple javascript

porlhews

Member
Hi All,

Anyone got any pointers as to why this custom javascript wont work:

Code:
var adult = this.get('value');
if(adult == '1'){Fabrik.getBlock('form_1').elements.get('jos_perm___count_checkbox').update('newvalue') ;}

Both the element in which this javascript is written and the cout_checkbox element are field elements.

In chrome, the consol says "Uncaught SyntaxError: Unexpected identifier "
Joomla 3.3
Fabrik 3.2
Php 5.5.18

http://fabrikar.com/forums/index.php?wiki/elements/#important-note-on-use-of-the-javascript-this

Thanks in advance,

Paul Hughes

P.S. I posted this in the community section too - apologies for the duplication.
 
Should work.
Is your formID=1?
Is jos_perm___count_checkbox an element in your form?
Check for typos.
 
Hi,

Yep the form ID is 1 and I've checked for typos. Yes all these are elements in my form.

Looking closer at the consol, the error appears to be associated with the preceeding element's javascript. I've copied the javascript consol in below (the error has underlined the line I've highlighted in red). However when I disable that preceeding element, the error is now associated with the preceeding error again. Furthermore, when I disable my count_checkbox element, no errors appear at all.


Fabrik.blocks['form_1'].dispatchEvent('dropdown', 'jos_perm___Internornot2', 'load', 'if (this.get(\'value\') == \'Domestic\') {Fabrik.blocks['form_1'].doElementFX(\'fabrik_trigger_group_group52\', \'hide\', this)}');

Fabrik.blocks['form_1'].dispatchEvent('field', 'jos_perm___Number_of_adults_required', 'click', 'var adult = this.get('value');if(adult == '1'){Fabrik.getBlock('form_1').elements.get('jos_perm___count_checkbox').update('newvalue') ;}');
 
Bump.

It's been a week now.

Appreciate the help from troester, but I'm still without a solution. I wouldn't mind, but I am volunteering for a charity to do this and other volunteers are relying on this.

Where are the fabrik staff?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top