以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- (已解决)(固定保存按钮)的校验和保存无效 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=127086) |
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 11:38:00 -- (已解决)(固定保存按钮)的校验和保存无效 问题如题。 参考帖: http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=106404 表单代码: Dim e As RequestEventArgs = args(0) Dim UserInfo As Win.YPD.UserInfo = args(1) Dim wb As New WeUI \'供应商新品申请 \'Case "gys_xpsq.htm" If e.PostValues.Count = 0 Then \'请求为0时 wb.Title = "供应商新品申请" \'添加标题
wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>", True) \'引入脚本文件 wb.AddToptips("", "toptip1", "") \'用于显示动态错误提示 wb.AddForm("", "form1", "handle.htm") \'指定接收表单数据的的页面为handle.htm里去做保存 \'表单字段内容--》》》 With wb.AddInputGroup("form1", "ipg1", "供应商新品申请") \'字段名 显示名 类型 .input属性 .AddInput("填表日期", "<label style=\'color:red;\'>填表日期</label>", "date") .AddInput("品名", "<label style=\'color:red;\'>品名</label>", "text").Placeholder = "请输入文本" .AddInput("规格", "<label style=\'color:red;\'>规格</label>", "text").Placeholder = "含量在前+数量" .AddInput("生产企业", "<label style=\'color:red;\'>生产企业</label>", "text").Placeholder = "全称" End With \'原操作按钮 \'With wb.AddButtonGroup("form1", "btg1", False) \'生成换页按钮
\'
.Add("btn1", "测试", "button").Attribute = " style=""position:fixed;bottom: .10em;left: 0;right: 0;"" "
\'位置固定底部
\' .Add("btn1", "新增", "button").Attribute = ""
\'提交(按钮单击调用函数)
\' .Add("btn1", "保存", "button").Attribute = ""
\'提交(按钮单击调用函数)
\'.Add("btn1", "保存", "submit")
\'提交
\' .Add("btn2", "重置", "reset") \'重置 \' .Add("btnLast", "返回", "", "default.htm") \'超链接 \'End With
\'参考按钮:
wb.InsertHTML("<style>.fox_h_button_group{position: fixed;bottom: .52em;left: 0;right: 0;}</style>") With wb.AddButtonGroup("form1","btg1", False) With .Add("btn0", "新增", "button").Attribute = "" \'.Kind = 0 End With With .Add("btn1", "保存", "button").Attribute = "" \'.Kind = 0 End With With .Add("btn2", "重置", "reset") \'.Kind = 0 End With With .Add("btnLast", "返回", "", "default.htm") \'.Kind = 0 End With End With With wb.AddDialog("", "dlg1", "错误", "") \'增加订单失败提示框 .AddButton("btnOK", "确定") End With With wb.AddDialog("", "dlg2", "提示", "当前数据添加成功,是否继续新增?") \'增加订单成功提示框 .AddButton("btnYes", "继续新增").Attribute = "" .AddButton("btnNo", "新品记录", "gys_xpsq_st.htm").Kind = 1 End With e.WriteString(wb.Build) \' End If \'判断结束 Return Nothing [此贴子已经被作者于2018/12/18 10:13:30编辑过]
|
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 11:41:00 -- 原操作按钮的保存和新建都是可以的, 参考按钮的保存和新建无效,求解感谢。
|
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 11:43:00 -- ajaxform.js----》》》 function myfunction() {
var nms = ["填表日期","品名","规格"]
document.write("数组----:"+nms);
for (var i=0;i<nms.length;i++)
{
var ZDname = document.getElementById(nms[i]);
if (ZDname.value==null || ZDname.value==\'\')
{
showTopTips("toptip1", nms[i]+"未填写!标红字段都为必填项!", 2500);
return false;
}
} var result = submitAjaxForm(\'form1\',\'\',false); if (result == null) { showTopTips("toptip1", \'服务器返回的信息为空!\', 2500); } else if (result == \'OK\') { show(\'dlg2\')
//showTopTips("toptip1", "保存成功!", 2500); } else { showTopTips("toptip1", result, 2500); } } |
||||||||||||
-- 作者:有点甜 -- 发布时间:2018/11/5 12:17:00 -- 你贴的代码丢失,请把代码放到txt文件上传上来查看;
[此贴子已经被作者于2018/11/5 12:17:42编辑过]
|
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 13:50:00 -- 好的 辛苦看下。
|
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 13:51:00 -- (ajaxform为js文件): |
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 14:04:00 -- 嗯我现在遇2个问题,求指导: 1.依上面所说,把表单按钮做成固定,但保存无效了。 2.当能够正常保存插入数据时,当前界面数据只保存插入一次,判断怎么写?不判断的话会重复保存。 就是如何获取数据库已有唯一字段值,和当前界面数据所属唯一值作比较看是否已存在。 (数据库唯一字段有了)
|
||||||||||||
-- 作者:有点甜 -- 发布时间:2018/11/5 14:52:00 -- 1、你js文件里面,没有myfunction()和myfunction2()函数;
2、你提交保存之后,在js里面,如果保存成功了,就跳转到另一个页面去,不就好了? |
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 15:33:00 -- 1.是有的,抱歉我发错了。 2.要不要跳转是一回事,不判断的话二次进入点保存还是会插入,另我保存要的效果是保存后留在当前界面。
|
||||||||||||
-- 作者:浪花兄弟 -- 发布时间:2018/11/5 17:19:00 -- 求帮忙看下 ![]() |