Ooops. Well actually I was wrong. Re-examining that line and the syntax is fine after all.
The rest of that was all part of the if - and it has a closing single quote after all.
Sorry for the misdirection.
Now I really feel obligated.
This is your code - right?
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') ;}');
From what I see - you are passing the string 'newvalue' as the update value when you should be passing the value of the variable adult (assuming that is your intent, right?).
So try 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(adult) ;}');
The only issue I see - even with that change, is - if the update field is a string and you are passing a number (the number 1 rather than the string '1') and trying to update a string with a number - then you will also get an error.
What I was trying to get at earlier is that you need to know if the var 'jos_perm___count_checkbox' is seen as a number or a string. And the problem you may have with your javascript is - when you assign the value of 'jos_perm___Number_of_adults_required' to the var 'adult' - is that being initialized by javascript as a number or a string value?
You never told us if jos_perm___count_checkbox and jos_perm___Number_of_adults_required are BOTH the same variable type. To save any headaches you might encounter (requiring the need for a var type conversion of number to string or string to number), they MUST be the same variable type in order for that last code change to work.
If that is not the case, (and you can't change the var type to be the same for both jos_perm___count_checkbox and jos_perm___Number_of_adults_required) then try either of these instead...
If 'jos_perm___count_checkbox' value is expected as a string, try...
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(
'1') ;}');
-or- you could assure 'adult' is a string by using the toString() function;
Fabrik.blocks['form_1'].dispatchEvent('field', 'jos_perm___Number_of_adults_required', 'click', '
var aval = this.get('value'); var adult = aval.toString(); if(adult ==
'1'){Fabrik.getBlock('form_1').elements.get('jos_perm___count_checkbox').update(
adult) ;}');
But if 'jos_perm___count_checkbox' value is expected as a number, try...
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(
1) ;}');
-or- you could assure 'adult' is a number by using the parseInt() function;
Fabrik.blocks['form_1'].dispatchEvent('field', 'jos_perm___Number_of_adults_required', 'click', '
var aval = this.get('value'); var adult = parseInt(aval); if(adult ==
1){Fabrik.getBlock('form_1').elements.get('jos_perm___count_checkbox').update(
adult) ;}');
If none of those work then I'm lost.