VBS/HTML Can't get InputBox to pop up
<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)
精彩评论