jvbao.htm代码:
wb.AddTopTips("bt3","toptip1","") '用于显示动态错误提示
wb.AddForm("bt3","form1","jvbao_fz")
With wb.AddInputGroup("form1","ipg1","举报证据")
.AddHidenValue("jvbaoym",jvbaoym)
.AddHidenValue("bbianh",tbh)
.AddHidenValue("ibh",txt_huiybh)
.AddHidenValue("ixb",txt_xingb)
.AddHidenValue("isj",txt_shouj)
With.AddUploader("up5","",True) 'True表示允许一次上传多个文件
.AllowDelete = True '允许删除
.Incremental = True '允许 重复选择文件或连续拍照
.ScaleWidth = 400 '自动压缩图片宽度为400个像素,高度等比例压缩
End With
.AddTextArea("bz",4).Placeholder = "请输入20~300字内举报描述"
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "提交", "button").Attribute= ""
End With
wb.AddToast("bt3","tst1", "正在上传",1)
wb.AddToast("bt3","tst2", "上传成功",0)
wb.AddToast("bt3","tst3", "上传失败",0).Icon= "warn"
With wb.AddDialog("bt3","dlg0-1", "请上传证据照片","")
.AddButton("btnn0-1-1","确定")
.AddButton("btnn0-1-2","前往首页","/index.htm")
End With
With wb.AddDialog("bt3","dlg0-2", "证据照最多可以上传20张","")
.AddButton("btnn0-2-1","确定")
.AddButton("btnn0-2-2","前往首页","/index.htm")
End With
With wb.AddDialog("bt3","dlg0-3", "没有输入文字描述","")
.AddButton("btnn0-3-1","确定")
.AddButton("btnn0-3-2","前往首页","/index.htm")
End With
With wb.AddDialog("bt3","dlg0-4", "请输入20~300字描述","")
.AddButton("btnn0-4-1","确定")
.AddButton("btnn0-4-2","前往首页","/index.htm")
End With
’******其他提示
wb.AppendHTML("<script src='./lib/ajaxform_jvbao.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
jvbao_fz.htm代码中的msgbox没有弹出,估计是js的原因(httprequest已经指向函数jvbao_fz)
js代码:
function validit_jvbao(){
var v2 = document.getElementById("up5_thumbnails").getElementsByTagName("li").length;
//alert(v2);
//alert(document.getElementById("bz").value);
//alert(document.getElementById("bz").value.length);
alert(document.getElementById("bz").value == ""); ’这里能够正常执行
if (v2 < 1) {show('dlg0-1'); return false;} //请止水上传1张证据照片
else if (v2 > 20) {show('dlg0-2'); return false;} //证据照最多可以上传20张
else if (document.getElementById("bz").value == "") {show('dlg0-3'); return false;}
else if (document.getElementById("bz").value.length < 10) {show('dlg0-4'); return false;}
else if (document.getElementById("bz").value.length > 300) {show('dlg0-4'); return false;}
//alert(v2);
//show("tst1",2000);
var result = submitAjaxForm('form1','',false);
alert(333333); //这里能正常提示
alert(result); //这里得到空
if (result =='没有输入文字描述!') {show('dlg1'); return false;}
//else if (result =='请输入20~300字描述!') {show('dlg2'); return false;}
else if (result =='没有找到举报人会员资料!') {show('dlg3'); return false;}
else if (result =='传递举报人会员编号错误!') {show('dlg4'); return false;}
else if (result =='没有找到被举报人会员资料!') {show('dlg5'); return false;}
else if (result =='传递被举报人会员编号错误!') {show('dlg6'); return false;}
else if (result =='被举报会员已经被禁用!') {show('dlg7'); return false;}
else if (result =='OK!') {show('dlg8'); return false;}
else if (result =='增加举报行失败!') {show('dlg9'); return false;}
}
为防止内容屏蔽,写入记事本上传: