javascript - Cannot read property 'length' of undefined when the inputs are not found on the page -
I'm getting dangerous "Unkot type error": the 'length' property of the undefined can not be read: 561 Window.onload "error, I am getting this page on the page where the input names given below are not found - As a result, the other jacquery that breaks it needs to be run after this, can I suppress this error by any means? And other junkies?
if ($ ("input [name = 'dnn $ ct R621 $ form $ qty '] "). Val () Length === 0) $ (" input [name =' dnn $ ctr621] $ form $ quantity '] ") Val (.' 0 '); if ( $ ("Input [name = 'dnn $ ctr621 $ form $ qty2']"). Val (). Length === 0) $ ("input [name = 'dnn $ ctr621 $ form $ qty2']"). Val ('0'); if ($ ("input [name = 'dnn $ ctr621 $ form $ qty3']"). Val (). Length === 0) $ ("input [name = 'dnn $ ctr621] $ Form $ qty3 '] ".val (' 0 '); if ($ (" input [name =' dnn $ ctr621 $ form $ qty4 '] "). Val (). Length === 0) $ ( "Input [name = 'dnn $ ctr621 $ form $ qty4']") .val ('0'); If ($ ("input [name = 'dnn $ ctr621 $ form $ qty5']"). Val (). Length === 0) $ ("input [name = 'dnn $ ctr621 $ form $ q55]]" ) .val ('0');
try it
function set value Name) {Var field = $ ("input [name = '" + name + "']"); Var value = field.val (); If (! Value) field .val ('0'); } Set Value ("DNN $ CTR 621 $ Form $ QTY"); SetValue ("$ ctr621 $ form $ qty2 dnn"); ...
Comments
Post a Comment