以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  http 的单选、多选如何设置必填项?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=109327)

--  作者:tesia255
--  发布时间:2017/11/9 15:36:00
--  http 的单选、多选如何设置必填项?

在HTTP中  如何设置 AddCheckGroup  AddRadioGroup AddInputGroup 里的控件都是必填项
另外,如何设置必填字段??

[此贴子已经被作者于2017/11/9 15:46:34编辑过]

--  作者:有点甜
--  发布时间:2017/11/9 15:54:00
--  

 要用js判断,参考

 

http://www.foxtable.com/mobilehelp/scr/0104.htm

 

 比如

 

if(某个id.value == "") {

    alert("xx必填")

    return

}


--  作者:tesia255
--  发布时间:2017/11/9 15:57:00
--  
您好   页面中有几个单选,然后有两个多选   多选后是一个多行文本,但是现在总是无法取值这个多行文本    ……  

取值多行文本的代码需要怎么写呢?

--  作者:有点甜
--  发布时间:2017/11/9 16:04:00
--  

直接不就可以获取了,如

 

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")
            .AddInput("nl","年龄","number")
            .AddInput("rq","日期","date")
            .AddSwitch("vip","VIP客户")
        End With
        With wb.AddInputGroup("form1","ipg2","备注")
            .AddTextArea("bz",5).Placeholder = "请输入200字以内的备注"
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "button").Attribute = "onclick=\'alert(bz.value)\'"
        End With
        e.WriteString(wb.Build) \'生成网页
End Select


--  作者:tesia255
--  发布时间:2017/11/9 16:17:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:调查问卷.zip





您看下 必填项没写出来   图片点击可在新窗口打开查看
[此贴子已经被作者于2017/11/9 16:32:25编辑过]

--  作者:有点甜
--  发布时间:2017/11/9 17:56:00
--  

Dim e As RequestEventArgs = args(0)
Dim wb As New weui
If e.PostValues.Count = 0 Then \'生成增加订单网页
   
    wb.AddPageTitle("","ph1","快保学吧","感谢您配合我们用户调研,我们会努力变更好!")
    wb.AddForm("","form1", "").Attribute="onsubmit=\'return validit()\'"
   
    With wb.AddInputGroup("form1","ipg1","您的信息")
        .AddSelect("省市","所在省市","北京|安徽|大连|广东|海南|河北|河南|湖北|湖南|江苏|江西|辽宁|内蒙|青岛|山东|陕西|上海|深圳|四川|天津|新疆|云南|浙江|重庆|其他")
        .AddSelect("年龄","您的年龄","18-25|26-32|33-40|41-50|50以上")
    End With
   
    With wb.AddRadioGroup("form1","学吧频次","您使用学吧频次?")
        .Add("高","高")
        .Add("中","中")
        .Add("低","低")
    End With
   
    With wb.AddRadioGroup("form1","分享","您分享过学吧内容吗?")
        .Add("经常分享","经常分享")
        .Add("很少分享","很少分享")
        .Add("没分享过","没分享过")
    End With
   
    With wb.AddRadioGroup("form1","业务分类","您是否希望学吧以业务线分类?(寿险,短意险,高端医疗,车险等)")
        .Add("希望以业务分类","希望以业务线分类")
        .Add("保持现状","保持现状")
        .Add("都行","都行")
    End With
   
    With wb.AddCheckGroup("form1","功能兴趣","您对学吧的哪些功能感兴趣?")
        .Add("产品解析","产品解析")
        .Add("专业提升","专业提升")
        .Add("玩转快保","玩转快保")
        .Add("资讯动态","资讯动态")
        .Add("保险理念","保险理念")
        .Add("基础知识","基础知识")
        .Add("资料百科","资料百科")
        .Add("新手上路","新手上路")
        .Add("学吧月刊","学吧月刊")
        .Add("很混乱","很混乱,分辨不清")
    End With
   
    With wb.AddCheckGroup("form1","了解途径","您通过什么途径了解学吧及相关功能?")
        .Add("晨会","晨会")
        .Add("夜校","夜校")
        .Add("听说","听说")
        .Add("微信","微信")
        .Add("其他","其他")
    End With
   
    With wb.AddInputGroup("form1","希望","您希望学吧为您提供怎样的内容?")
        .AddTextArea("bz",5).Placeholder = "请输入200字以内的备注"
    End With
   
    With wb.AddButtonGroup("form1","btg1",True)
        .Add("btn1", "提交", "submit")
    End With
    wb.AppendHTML("<script>function validit() {if(高.checked == false && 中.checked == false && 低.checked == false) {alert(\'频次不能为空\'); return false;};if(bz.value == \'\') {alert(\'备注不能为空\'); return false;};  return true }</script>")

    e.WriteString(wb.Build)
   
Else \'保存新增的订单
   
   
    Dim dr As DataRow = DataTables("表A").AddNew()
    Dim nms() As String = {"省市","年龄","学吧频次","分享","业务分类"}
    For Each nm As String In nms                
            dr(nm) = e.PostValues(nm)
    Next
   

    Dim pp As String
    nms = New String() {"产品解析","专业提升","玩转快保","资讯动态","保险理念","基础知识","资料百科","新手上路","学吧月刊","很混乱,分辨不清"}
    For Each nm As String In nms
        If e.PostValues.ContainsKey(nm) AndAlso e.PostValues(nm).Trim() = "on" Then
            pp = pp & nm  & ","
        End If
    Next
    If pp > "" Then
        dr("功能兴趣") = pp.Trim(",")
    End If
   
    Dim pp2 As String
    nms = New String() {"晨会","夜校","听说","微信","其他"}
    For Each nm As String In nms
        If e.PostValues.ContainsKey(nm) AndAlso e.PostValues(nm).Trim() = "on" Then
            pp2 = pp2 & nm  & ","
        End If
    Next
    If pp2 > "" Then
        dr("了解途径") = pp2.Trim(",")
    End If

 Dim pp3 As String
    nms = New String() {"希望"}
    For Each nm As String In nms
        If e.PostValues.ContainsKey(nm) AndAlso e.PostValues(nm).Trim() = "on" Then
            pp3 = pp3 & nm  & ","
        End If
    Next
    If pp3 > "" Then
        dr("希望") = pp3.Trim(",")
    End If

   
    dr.Save()
    With wb.AddMsgPage("","msgpage","增加成功", "感谢您的配合! 好好学习,天天向上!")
        .AddButton("btn1","继续增加","addnew.htm")
    End With
    e.WriteString(wb.Build) \'生成网页
End If