Foxtable(狐表)用户栏目专家坐堂 → 如果实现Uploader中必须要有文件才可 以提交表单


  共有3262人关注过本帖树形打印复制链接

主题:如果实现Uploader中必须要有文件才可 以提交表单

帅哥哟,离线,有人找我吗?
ap9709130
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1467 积分:11418 威望:0 精华:0 注册:2013/11/24 22:10:00
  发帖心情 Post By:2017/5/9 17:12:00 [只看该作者]

老师,今天试了一天,都搞不定,代码如下:请帮忙看一下
wb.AddForm("","form1","http://mt.gzhito.com.cn/shjg.htm?id=" & e.GetValues("id") & "&user=" & e.GetValues("user") & "") 'Attribute = "" 
With wb.AddButtonGroup("form1","btg1",True)
                    .Add("btn1", "确定", "button").Attribute = ""
                End With
                With wb.AddDialog("","dlg2", "删除确认","请确认货物是否已经送达?")
                    .AddButton("btnCancel","取消").Kind = 1
                    .AddButton("btnOK","确定")
                End With
                With wb.AddDialog("","dlg5", "送货确认成功!","") '增加订单失败提示框
                   .AddButton("btnOK","确定")
                End With
                With wb.AddDialog("","dlg3", "错误","") '增加订单失败提示框
                    .AddButton("btnOK","确定")
                End With

JS:
function shqr(){
   var v1 = document.getElementById("shd1").files.length;  
   if (v1 > 0){
show("dlg2")
return true
}
   show("toptip1",2000);
   return false;
}
function myfunction(){
    var result = submitAjaxForm('form1','',false);
    if (result =='qrcg') {show('dlg5')}
    else {showDialog('dlg3','错误',result)}
}

服务器端没问题,就是出不了对话框!

 回到顶部
帅哥哟,离线,有人找我吗?
ap9709130
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1467 积分:11418 威望:0 精华:0 注册:2013/11/24 22:10:00
  发帖心情 Post By:2017/5/9 17:14:00 [只看该作者]

wb.AddForm("","form1","http://mt.gzhito.com.cn/shjg.htm?id=" & e.GetValues("id") & "&user=" & e.GetValues("user") & "") 'A ttr ib ut e = "ons ubm it='re tur n myf unc tion()'" 

 回到顶部
帅哥哟,离线,有人找我吗?
ap9709130
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1467 积分:11418 威望:0 精华:0 注册:2013/11/24 22:10:00
  发帖心情 Post By:2017/5/9 17:15:00 [只看该作者]

Add("btn1", "确定", "button").Attr ib ute = "on clic k='sh qr()'"

 回到顶部
帅哥哟,离线,有人找我吗?
ap9709130
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1467 积分:11418 威望:0 精华:0 注册:2013/11/24 22:10:00
  发帖心情 Post By:2017/5/9 17:15:00 [只看该作者]

如果单独 提交是没有问题的,会显示内空:qrcg

 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/9 18:33:00 [只看该作者]

 如果你用13楼的代码,肯定能弹出对话框。点击确定按钮的时候,再提交到服务器囖。

 

 提交表单的代码这样写 document.getElementById('form1').submit();


 回到顶部
帅哥哟,离线,有人找我吗?
ap9709130
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1467 积分:11418 威望:0 精华:0 注册:2013/11/24 22:10:00
  发帖心情 Post By:2017/5/9 21:12:00 [只看该作者]

老师

我的想法是,当用户click dlg2的确定时,把数据提交给服务器,处理完成后,弹出dlg5,告诉用户,已经处理成功!

 回到顶部
帅哥,在线噢!
有点蓝
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107744 积分:548059 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/5/9 22:22:00 [只看该作者]

wb.AddForm("","form1","http://mt.gzhito.com.cn/shjg.htm?id=" & e.GetValues("id") & "&user=" & e.GetValues("user") & "") 'Attribute = ""
With wb.AddButtonGroup("form1","btg1",True)
    .Add("btn1", "确定", "button").Attribute = "onclick='shqr()'"
End With
With wb.AddDialog("","dlg2", "删除确认","请确认货物是否已经送达?")
    .AddButton("btnCancel","取消").Kind = 1
    .AddButton("btnOK","确定").Attribute = "onclick=myfunction()'"
End With
With wb.AddDialog("","dlg5", "送货确认成功!","") '增加订单失败提示框
    .AddButton("btnOK","确定")
End With
With wb.AddDialog("","dlg3", "错误","") '增加订单失败提示框
    .AddButton("btnOK","确定")
End With

 回到顶部
总数 17 上一页 1 2