in an ACBC I would like to localize the amount shown in the "cost for feature" column (right most column). I want the "underlying" values to not change (for modelling purposes in the back-end I need all respondents to use the same currency), so it's really only to display local values. I am fine with the level cost showing in the actual BYO question are in $ (the "(+ $xxx) shown next to level text.
My script works when all attributes are shown. But the attribute list is dynamic meaning some attributes can be left out and then I run into the issue that some cells are "undefined" and the js stops running.
My code (only showing 2 attributes)
var price1 = parseInt($('#ACBC1_BYO_price1').val().replace(',',''));
var local1 = $.number(price1 * [% Value(multiplier) %],0,".",",");
var price2 = parseInt($('#ACBC1_BYO_price2').val().replace(',',''));
var local2 = $.number(price2 * [% Value(multiplier) %],0,".",",");
var price = parseInt($('#ACBC1_BYO_13').val().replace(',',''));
var local = $.number(price * [% Value(multiplier) %],0,".",",");
The 3rd set is to update the total price shown at the bottom of the BYO.
So this works when both attributes 1 and 2 are in the ACBC. But if attribute 1 is dropped from the ACBC, then I get the "undefined" error since #ACBC1_BYO_price1 does not exist on the page.
I tried defining variable differently but could not get this to work.