将来自 HTML 的用户输入传递到 VBScript
Pass user input from HTML into VBScript
我正在尝试在 HTML 中创建一个简单的用户界面,要求用户输入传输量的整数。我想将该输入用作 VBScript 中的变量,但我一直收到显示输入错误。比如用户输入50,我想让消息框显示50。
<html>
<form>
<label for="transfer_vol">Transfer Volume:</label>
<input type="number" name="transfer_vol" id=transfer_vol min="0"
max="200" size="8">
</form>
<script language="vbscript" type="text/Vbscript">
<!--
Function displayValue(transfer_vol)
Msgbox(transfer_vol)
End Function
//-->
</script>
<input type = "button" onclick = "displayInput(transfer_vol)" value = "Confirm Parameters" />
</html>
如果您想使用 vbscript,我建议您使用 HTA 而不是 HTML:
<html>
<head>
<title>Pass user input from HTA into VBScript</title>
<HTA:APPLICATION
Application ID = "Input"
APPLICATIONNAME = "Input"
BORDER = "Dialog"
BORDERSTYLE = "Normal"
/>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<style type="text/css">
body {
font-family:Verdana;
font-size: 12px;
color: #49403B;
background: LightBlue;
}
</style>
<script language="vbscript" type="text/Vbscript">
Function displayValue()
Set vol = document.getElementbyID("transfer_vol")
Msgbox(vol.value)
End Function
</script>
</head>
<body>
<label>Transfer Volume:</label>
<input type="text" name="transfer_vol" id="transfer_vol" max="200" size="8">
<input type="button" onclick="displayValue" value = "Confirm Parameters" />
</boy>
</html>
我正在尝试在 HTML 中创建一个简单的用户界面,要求用户输入传输量的整数。我想将该输入用作 VBScript 中的变量,但我一直收到显示输入错误。比如用户输入50,我想让消息框显示50。
<html>
<form>
<label for="transfer_vol">Transfer Volume:</label>
<input type="number" name="transfer_vol" id=transfer_vol min="0"
max="200" size="8">
</form>
<script language="vbscript" type="text/Vbscript">
<!--
Function displayValue(transfer_vol)
Msgbox(transfer_vol)
End Function
//-->
</script>
<input type = "button" onclick = "displayInput(transfer_vol)" value = "Confirm Parameters" />
</html>
如果您想使用 vbscript,我建议您使用 HTA 而不是 HTML:
<html>
<head>
<title>Pass user input from HTA into VBScript</title>
<HTA:APPLICATION
Application ID = "Input"
APPLICATIONNAME = "Input"
BORDER = "Dialog"
BORDERSTYLE = "Normal"
/>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<style type="text/css">
body {
font-family:Verdana;
font-size: 12px;
color: #49403B;
background: LightBlue;
}
</style>
<script language="vbscript" type="text/Vbscript">
Function displayValue()
Set vol = document.getElementbyID("transfer_vol")
Msgbox(vol.value)
End Function
</script>
</head>
<body>
<label>Transfer Volume:</label>
<input type="text" name="transfer_vol" id="transfer_vol" max="200" size="8">
<input type="button" onclick="displayValue" value = "Confirm Parameters" />
</boy>
</html>