scripts[] = info.js
and the .js file is in the same dir as the .info file (for now)$(document).ready(function() {
$('#edit-submitted-num1').change(function() {
alert('num1 changed!');
});
});
(function ($) {
$(document).ready(function(){
var content = '';
$('#edit-submitted-cat-1-reim-prior,#edit-submitted-cat-1-reim-curr,#edit-submitted-cat-1-reim-total').change(function() {
content1 = parseInt($('#edit-submitted-cat-1-reim-prior').val(), 10);
content2 = parseInt($('#edit-submitted-cat-1-reim-curr').val(), 10);
contentTotal = parseInt(content1 + content2);
$('#edit-submitted-cat-1-reim-total').val(contentTotal);
});
});
})(jQuery);
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Open in new window
More here: http://drupal.org/node/171213