以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- HBuider扫码与submitAjaxFileds (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=126304) |
-- 作者:石四 -- 发布时间:2018/10/18 13:52:00 -- HBuider扫码与submitAjaxFileds Select Case e.path Case "prod.htm" Dim wb As new weui wb.AppendHTML("<script type=\'text/javascript\' src=\'/" & path & "/js/common.js\'></script>", True) wb.AppendHTML("<link rel=\'stylesheet\' href=\'/" & path & "/css/common.css\' Type=\'text/css\' charset=\'utf-8\'/>", True) wb.AddForm("","form1","prod.htm") With wb.AddInputGroup("form1","ipg1","现场盘点") Dim UserName As String = e.Cookies("username") \'从cookie中获取用户名 Dim Val3 As String = DecryptText(UserName,"123","123") \'解密,两个密钥必须和加密的时候 Dim Val4 As Date = Date.today .AddHiddenValue("date",Val4) .AddHiddenValue("statistics",Val3) \' .AddInput("图号","图号","Text") With .AddInput("code","图号","") .Attribute = "" \'调用js函数 End With .AddInput("product","名称","Text") .AddInput("classify","类别","Text") .AddInput("number","数量","Number") .AddInput("remarks","备注","Text") End With With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "确定", "submit") .Add("btn1", "扫一扫", "button").Attribute = " & path & "/plus/barcode_scan.html\',true,true);""" .Add("btn1", "返回", "button").Attribute = "" End With wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById(\'code\').value=r;}</script>") wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) Case "getCodes.htm" Dim y As Integer = Date.Today.Year Dim m As Integer = Date.Today.Month Dim mt As New Date(y, m, 1) Dim cmd As New SQLCommand Dim dt As DataTable Dim cr As DataRow cmd.C cmd.CommandText = "Select * Fr om {期初表} Where 日期 = #" & mt & "# " dt = cmd.ExecuteReader Dim dr As DataRow = dt.Find("零件图号=\'" & e.Values("code") & "\'") If dr IsNot Nothing Then e.WriteString(dr("零件名称") & "|" & dr("备注")) End If End Select --------------------- 手动输入图号有效,扫二维输入图号没有动静,如何触发? |
-- 作者:有点甜 -- 发布时间:2018/10/18 14:59:00 -- 在红色地方调用js代码ajax访问后台返回数据
wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById(\'code\').value=r;这里调用js代码}</script>") |
-- 作者:石四 -- 发布时间:2018/10/19 14:43:00 -- 是这么用onchang吗?但是还是没有动静
|
-- 作者:有点蓝 -- 发布时间:2018/10/19 14:56:00 -- 又不是控件,onchang啥。 wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById(\'code\').value=r;setCodes();}</script>")
|
-- 作者:石四 -- 发布时间:2018/10/19 15:31:00 -- 哦,好了,又学会一招,谢谢。 |
-- 作者:石四 -- 发布时间:2018/10/20 14:24:00 -- 为什么setCodes()放到项目里就触发不了呢?单个网页是可以,通过登记页面进入主页,再进入下一页面就失效了,控件那里手动input编码也没动静 |
-- 作者:有点蓝 -- 发布时间:2018/10/20 14:49:00 -- 引入js文件了吗?http://www.foxtable.com/mobilehelp/scr/0061.htm |
-- 作者:石四 -- 发布时间:2018/10/20 15:12:00 -- Select Case e.path Case "prod.htm" Dim wb As new weui wb.AppendHTML("<script type=\'text/javascript\' src=\'/" & path & "/js/common.js\'></script>", True) wb.AppendHTML("<link rel=\'stylesheet\' href=\'/" & path & "/css/common.css\' Type=\'text/css\' charset=\'utf-8\'/>", True) wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 If e.PostValues.Count = 0 Then ................. 引入了呀
|
-- 作者:石四 -- 发布时间:2018/10/20 15:15:00 -- 直接测试prod.htm这个页面正常的,套进主页就不行 |
-- 作者:有点蓝 -- 发布时间:2018/10/20 15:21:00 -- 怎么套的?贴出完整代码 |