检测文本输入框的输入,通过不同输入,得到不同信息,我点击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>
复制代码
|