标题: [问题求助] [已解决]VBS检测文本输入框的输入,通过不同输入,得到不同信息 [打印本页]
作者: c755731262 时间: 2015-5-16 23:09 标题: [已解决]VBS检测文本输入框的输入,通过不同输入,得到不同信息
检测文本输入框的输入,通过不同输入,得到不同信息,我点击submit没反应,- <html>
- <head>
- <title>
- 测试哪里出问题了
- </title>
- <script language="vbscript">
-
- function jiance(snumber,imin,imax)
- if isnumeric(snumber) then
- if instr(snumber,".")=0 then
- if clng(snumber)>=imin and clng(snumber)<=imax then
- jiance=""
- else
- msgbox jiance="please enter a number between "&imin&" and "&imax
- end if
- else
- msgbox jiance="please enter an integer"
- end if
- else
- msgbox jiance="please enter a number"
- end if
- end function
-
- sub form_onsubmit()
- dim s
- s=jiance(form.text.value,1,10)
- if s="" then
- msgbox "valid"
- else
- msgbox "try again"
- end if
- end sub
-
- </script>
- </head>
- <body>
- <form action="" name="form" method="post">
- <input type="text" name="text">
- <input type="submit" name="submit" value="submit">
- </form>
- </body>
- </html>
复制代码
作者: czjt1234 时间: 2015-5-17 12:28
- <html>
- <head>
- <title>
- 测试哪里出问题了
- </title>
- <script language="vbscript">
-
- function jiance(snumber,imin,imax)
- if isnumeric(snumber) then
- if instr(snumber,".")=0 then
- if clng(snumber)>=imin and clng(snumber)<=imax then
- jiance=""
- else
- jiance="please enter a number between "&imin&" and "&imax
- msgbox jiance
- end if
- else
- jiance="please enter an integer"
- msgbox jiance
- end if
- else
- jiance="please enter a number"
- msgbox jiance
- end if
- end function
-
- sub form_onsubmit()
- dim s
- s=jiance(form.text.value,1,10)
- if s="" then
- msgbox "valid"
- else
- msgbox "try again"
- end if
- end sub
-
- </script>
- </head>
- <body>
- <form action="" name="form" method="post">
- <input type="text" name="text">
- <input type="submit" name="submit" value="submit">
- </form>
- </body>
- </html>
复制代码
IE8测试通过
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |