此主题相关图片如下:qq20240815-084325.png
如图,这是一个网页录入页面,怎样可以在第一个文本框按下ENTER时不提交数据而时将焦点跳到第二个文本框,只要按下确定是才提交数据
Select Case e.Path
Case "test.htm"
Dim wb As New weui
wb.AddForm("", "form1", "test.htm")
With wb.AddInputGroup("form1", "ipg1", "登录")
.AddInput("xm", "户名", "text").Attribute = "onkeydown=""next('pw')"""
.AddInput("pw", "密码", "text").Attribute = "onkeydown=""next('qt')"""
.AddInput("qt", "其它", "text")
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn1", "确定", "button").Attribute = "onclick=""submitAjaxForm('form1','',false);"""
.Add("btn5", "主页", "", "http://www.foxtable.com")
End With
wb.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
End Select
ajaxform.js-------------
function next(id) {
if (event.key === 'Enter') {
event.preventDefault();
document.getElementById(id).focus();
}
}