Calculation Onload in v3.1

hominid4

Member
Hi, we have a form (id 1) with several calculation elements that calculate when the page loads, we've been doing that with the below code in our 1.js custom file that targets the "f_p_comic___int_count" dropdown element. After upgrading to v3.1 we now receive a "Can't find variable: head" JS error for the "head.ready(function(){". I changed the ready function to "window.addEvent('domready', function() {" which removed the error but the form doesn't calculate.
Code:
head.ready(function(){
var dd = $('f_p_comic___int_count');
var evnt = {target: dd, stop: $empty};
dd.fireEvent('change', evnt)
});

What I'm doing now is placing the below code in one of the calc elements Javascript tab with a "load" action, and is working fine, but was hoping I could switch back to my 1.js file. Is there a code adjustment that I can make?
Code:
var dd = $('f_p_comic___int_count');
var evnt = {target: dd, stop: $empty};
dd.fireEvent('change', evnt)

Thanks!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top