开发者

VBS/HTML Can't get InputBox to pop up

开发者 https://www.devze.com 2023-03-10 15:50 出处:网络
<html> <body> <script type=\"text/vbscript\"> Function sub() Ms=MsgBox(UN, 1) End Function
<html>
<body>
<script type="text/vbscript">
Function sub()
Ms=MsgBox(UN, 1)
End Function
</script>

Username: <input
 id="UN"
 type=text>
 <br/>

Password: <input
 name="PW"
 type=password>
 <br/>

<input
 name="Submit"
 type=submit
 onclick="sub()">

</body>
</html>

When the submit button is pressed, the function does开发者_开发知识库n't show the MsgBox at all. Let alone the username..


You are using a reserved word, just change Function sub() to something like Function mySub() and it will work.

If you want the value, then you need to do Ms=MsgBox(UN.value, 1) instead of Ms=MsgBox(UN, 1)

0

精彩评论

暂无评论...
验证码 换一张
取 消