关于Input值的获取

stephen0403 2009-10-21 09:48:31
各位,有个问题求助各位,我想把input的值提取出来,应该怎么实现啊。看了下是要用Javascript,求助下各位。

转到<input name=PageNo type="text" size="4" style="height:12px; width:20px; border:1px solid #999999;">页</span><a href="test.asp?PageNo=<%=PageNo%>"><img src="../images/go.gif" width="37" height="15" border="0" /></a>]
...全文
68 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
BeenZ 2009-10-21
  • 打赏
  • 举报
回复
不是为空,是不存在
BeenZ 2009-10-21
  • 打赏
  • 举报
回复
input为空不会出错啊,name为PageNo 的控键为空才会报错
stephen0403 2009-10-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 beenz 的回复:]
HTML code
转到<inputname=PageNotype="text" size="4" style="height:12px; width:20px; border:1px solid #999999;">页</span><ahref="test.asp?PageNo=<%=PageNo%>"><imgsrc="../images/go.gif" width="37" height="¡­
[/Quote]

用winonload 如果input为空的话 就是错误了啊。
BeenZ 2009-10-21
  • 打赏
  • 举报
回复

转到<input name=PageNo type="text" size="4" style="height:12px; width:20px; border:1px solid #999999;">页</span><a href="test.asp?PageNo=<%=PageNo%>"><img src="../images/go.gif" width="37" height="15" border="0" /></a>]
<script>
window.onload=function(){
var inputRet=document.getElementsByName("PageNo")[0].value;//得到值
alert(inputRet)
}
</script>
sumjor 2009-10-21
  • 打赏
  • 举报
回复
aa = document.form.pageNO.value

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧