这是测试代码,没有使用按钮,第二个文本框会接受数字如果值为< =第一个文本框。第二个输入类型=“数字”的值不能超过第一个输入类型的值=“number”maxlength =“3”
<html>
<body>
<input id="first" name="first" type="number" maxlength = "3">
<input id="second" name="second" type="number" maxlength = "3" onblur="compare()" >
</body>
</html>
<script type="text/javascript">
function compare()
{
var firstNumber = document.getElementById("first").value;
var secondNumber = document.getElementById("second").value;
if(firstNumber >= secondNumber)
{
//nothing will do, continue to the 3rd textbox.
}
else
{
alert("The number you enter is larger than the first one.");
//clear the value of the second textbox
}
}
</script>
您的标题是您正在获取的错误消息,还是您想要实现的目标?究竟是什么问题?附:看起来像纯html,没有asp-classic/vbscript代码。 – Dijkgraaf
对不起,先生,我的坏..,我将这个代码导入到我的asp文件(完整的代码),如果我的关注解决。 – rabal
那么你的问题是什么?代码是否按预期工作? – Dijkgraaf