日期:2014-05-17  浏览次数:20696 次

怎么在过程中去表单中单行文本框中的值
如下,谢谢!^_^
<%@LANGUAGE= "VBSCRIPT "   CODEPAGE= "936 "%>
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 测试 </title>
<script   language= "vbscript ">
sub   myok(str)
    dim   uname
    怎么在此处使变量uname的值取得下面form中单行文本框中的输入值。
End   sub
</script>
</head>

<body>
<form>
Login: <input   type= "text "   name= "uname "   size= "20 "   /> <BR   />
password: <input   type= "button "   value= "OK "   name= "btnOK "   onclick= "myok( 'liulei ') "
</form>
</body>
</html>



------解决方案--------------------
肯定要有个事件触发myok(str)
dim uname
uname=form1.uname.value;
------解决方案--------------------
或者
uname=document.forms[0].uname.value;
------解决方案--------------------
uname=document.getElementById( "uname ").value;