target に textbox が存在しない事がエラーの原因なら
value を参照する前に textbox が null でないかチェックすればエラーは回避できる

if (target.textbox && target.textbox.value)