How to update a field element via JavaSript

Hi,

I'm not that good in JS :)

I'm simply trying to get a value from a field I've manually updated via JS code (on change).
If you want to see it, go to:
http://beta1.volver-amenities.com/test-calc
You see the two last fields (tes1 & test2)
I simply want to update field Test2 with the value of Test1, after inserted. So I put this code in a "on change" JS event:
Code:
var $name = $('test___test1');
var $name2 = $('test___test2');
value = $name.getValue();
value2 = $name2.getValue();
$name2.set('50');
alert(value+' '+value2);
No way, popup shows values, so field names are right and values are picked up, but Test2 field is not updated.
Somewhere I've read elements must be accessed in a different way, but the following code doesn't work at all:
Code:
var nam = Fabrik.getBlock('test').formElements.get('test___test1');
value = nam.get('value');
alert(value);

Does anyone have an idea? Thanks
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top