2013-04-24 76 views
0

属性“价值”在下面的脚本,当我在控制台中的customFields输入一个运行它,在KEYUP,它返回一个错误:jQuery的:遗漏的类型错误:无法读取的不确定

Uncaught TypeError: Cannot read property 'value' of undefined

任何人看到有什么问题?

jQuery(document).ready(function() { 

     jQuery("#customfield_21070").attr('style', 'width:60px'); 

     var customfields = '#customfield_11070,#customfield_11071,#customfield_20071,#customfield_20072,#customfield_20073,#customfield_20074'; 

      jQuery(customfields).keyup(function() { 
       calculateSum.call(this); 
      }); 


     function calculateSum(param) { 
      var sum = 0; 

      if (!isNaN(param.value) && param.value.length != 0 && param.id !== "customfield_21070") { 
       sum += parseFloat(param.value); 
      } 

      jQuery("#customfield_21070").val(sum.toFixed(2)); 
     } 

    }); 

回答

相关问题