[Webtest] TypeError: Cannot set property "value" of undefined to "0"

smashell smashell <shanghai1980@gmail.com>
Wed, 21 Oct 2009 12:02:24 +0800


my canoo webtest version is=C2=A0R_1786=C2=A0Posted: 15-Oct-2009 13:17

when I click a button it says:

Details

javascript errorTypeError: Cannot set property "value" of undefined to "0"
line0
javascript sourcefunction () { [native code, arity=3D0] }
failing linefunction () {
javascript call stackTypeError: Cannot set property "value" of
undefined to "0" at (onclick event for HtmlSubmitInput[<input
type=3D"submit" value=3D"ok" class=3D"b"
onclick=3D"document.f1.pic.value=3D1;document.f1.clk.value=3D0;"
tabindex=3D"2">] in http://www.mysite.com/)



Html source:
<input class=3D"b" type=3D"submit" tabindex=3D"2"
onclick=3D"document.f1.pic.value=3D1;document.f1.clk.value=3D0;"
value=3D"=E8=BF=9B=E5=85=A5=E8=AF=8D=E6=9D=A1"/>

<script type=3D"text/javascript">var
options=3D{onconfirm:function(D,A,H,C){var
E=3Ddocument.f1;E.pic.value=3D1;if(!G("sug_clk")){if(A>=3D0){var
I=3Ddocument.createElement("INPUT");I.type=3D"hidden";I.name=3D"clk";I.id=
=3D"sug_clk";I.value=3D1;E.appendChild(I)}}else{if(A>=3D0){G("sug_clk").val=
ue=3D1}}if(!G("sug_rsp")){var
B=3Ddocument.createElement("INPUT");B.type=3D"hidden";B.name=3D"rsp";B.id=
=3D"sug_rsp";B.value=3DA;E.appendChild(B)}else{G("sug_rsp").value=3DA}E.sub=
mit()},getData:function(B){if(navigator.cookieEnabled&&!getCookie("baikesug=
")){var
C=3Ddocument.f1;if(!G("sug_oq")){var
D=3Ddocument.createElement("INPUT");D.type=3D"hidden";D.name=3D"oq";D.id=3D=
"sug_oq";D.value=3DB;C.appendChild(D)}else{G("sug_oq").value=3DB}var
A=3Ddocument.getElementById("baikeSugSc");if(A){document.body.removeChild(A=
)}var
A=3Ddocument.createElement("script");A.src=3D"http://baike.sug.baidu.com/su=
?wd=3D"+encodeURIComponent(B)+"&t=3D"+(new
Date()).getTime();A.id=3D"baikeSugSc";document.body.appendChild(A)}},append=
_html:"<div
class=3D'sug_close'><a href=3D'javascript:void(0)'
onclick=3DbaikeSug.close();sendStat('sugclose')>close</a></div>"};var
baikeSug=3D{};function suggestion(){if(!navigator.cookieEnabled){return
false}if(!getCookie("baikesug")){baikeSug=3Dbaidu.suggestion.create(baidu.G=
("kw"),options);baikeSug.close=3Dfunction(){baikeSug.hide();baidu.G("kw").s=
etAttribute("autocomplete","on");setCookie("baikesug","1","","/",location.h=
ost.replace(/:\d+/,""))}}}suggestion();baidu.sug=3Dfunction(D){if(!D){retur=
n
}var C=3D[];for(var A=3D0;A<D.s.length;A++){var
E=3D{};E.input=3DB(D.s[A]);E.selection=3DD.s[A];C.push(E)}baikeSug.giveData=
(D.q,C);function
B(I){var H=3Ddocument.createElement("textarea");try{H.innerHTML=3DI}catch(F=
){H.value=3DI}return
H.value}};</script>