以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  注册界面  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=97378)

--  作者:zhangjian222200
--  发布时间:2017/3/10 19:29:00
--  注册界面
注册页面,生成的页面如下图,如果手机(11位字符)、密码(6~10位字符)、性别(一个字符)、同意协议已经填写,暂不考虑手机验证码,点击注册按钮,则进入http://127.0.0.1/fillout.htm,我已根据移动指南:“一个录入界面”,写了代码,但是功能并未实现,请帮瞧瞧,谢谢!

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20170310191707.png
图片点击可在新窗口打开查看
代码如下:
Dim e As RequestEventArgs = args(0)                             \'注册第1页,注册
Select Case e.Path
    Case "register.htm"
        Dim wb As New weui
        If e.PostValues.Count = 0 Then
            wb.AddPageTitle("","pageheader","hh网","2222222222护航")
            wb.AddForm("","form1","register.htm")
            With wb.AddInputGroup("form1","ipg1","快速注册")
                With .AddInputCell("ic1")  \'通过InputCell增加输入框(1表示突出显示,2表示红色警示图标)
                    .AddLabel("lsj","手机",0)  \'增加标签(0显示在左边)
                    .AddInput("isj","text",1).PlaceHolder= "请输入手机号"  \'增加输入框(0靠左显示,1居中显示,2靠右显示)
                End With
                With .AddInputCell("ic2")
                    .AddLabel("lyz","验证",0)
                    .AddInput("iyz","text",1).PlaceHolder= "请输入验证码"
                    .AddVcodeButton("vyz","获取验证码",2)  \'0靠左显示,1居中显示,2靠右显示
                End With
                With .AddInputCell("ic3")
                    .AddLabel("lmm","密码",0)
                    .AddInput("imm","text",1).PlaceHolder= "请输入密码"
                End With
                .AddSelect("sxb","性别","|男|女")
                .AddSwitch("fuwuxieyi","同意协议")
                With wb.AddButtonGroup("form1","btg1",True)
                    .Add("btn1", "注册", "","http://127.0.0.1/fillout.htm")
                    .Add("btn1", "查看服务协议", "","http://127.0.0.1/fillout.htm").Kind = 1
                End With
            End With
        Else
            Dim nms() As String = {"手机","密码","性别","同意协议"} \'不能为空的列名数组
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) = False Then \'生成错误提示页
                    With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
                        .icon = "Warn" \'改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                    Return "" \'必须返回
                End If
            Next
            nms = New String() {"手机","密码","性别","同意协议"}  \'重新定义了nms数组,增加了两列.
            Dim dr As DataRow = DataTables("会员资料").AddNew()
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) Then
                    dr(nm) = e.PostValues(nm)
                End If
            Next
            \'保存并生成增加成功提示页面
            dr.save()
            With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") \'生成成功提示页
                .AddButton("btn1","继续增加","addnew.htm")
            End With
        End If
        e.WriteString(wb.Build)
End Select


--  作者:有点蓝
--  发布时间:2017/3/10 20:48:00
--  
Dim e As RequestEventArgs = args(0)                             \'注册第1页,注册
Select Case e.Path
    Case "register.htm"
        Dim wb As New weui
        If e.PostValues.Count = 0 Then
            wb.AddPageTitle("","pageheader","hh网","2222222222护航")
            wb.AddForm("","form1","register.htm")
            With wb.AddInputGroup("form1","ipg1","快速注册")
                With .AddInputCell("ic1")  \'通过InputCell增加输入框(1表示突出显示,2表示红色警示图标)
                    .AddLabel("lsj","手机",0)  \'增加标签(0显示在左边)
                    .AddInput("isj","text",1).PlaceHolder= "请输入手机号"  \'增加输入框(0靠左显示,1居中显示,2靠右显示)
                End With
                With .AddInputCell("ic2")
                    .AddLabel("lyz","验证",0)
                    .AddInput("iyz","text",1).PlaceHolder= "请输入验证码"
                    .AddVcodeButton("vyz","获取验证码",2)  \'0靠左显示,1居中显示,2靠右显示
                End With
                With .AddInputCell("ic3")
                    .AddLabel("lmm","密码",0)
                    .AddInput("imm","text",1).PlaceHolder= "请输入密码"
                End With
                .AddSelect("sxb","性别","|男|女")
                .AddSwitch("fuwuxieyi","同意协议")
                With wb.AddButtonGroup("form1","btg1",True)
                    .Add("btn1", "注册", "submit")
                    .Add("btn1", "查看服务协议", "","/fillout.htm").Kind = 1
                End With
            End With
        Else
            Dim nms() As String = {"手机","密码","性别","同意协议"} \'不能为空的列名数组
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) = False Then \'生成错误提示页
                    With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
                        .icon = "Warn" \'改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                    Return "" \'必须返回
                End If
            Next
            nms = New String() {"手机","密码","性别","同意协议" }  \'重新定义了nms数组,增加了两列.
            Dim dr As DataRow = DataTables("会员资料").AddNew()
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) Then
                    dr(nm) = e.PostValues(nm)
                End If
            Next
            \'保存并生成增加成功提示页面
            dr.save()
            wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") \'直接跳转到首页
        End If
        e.WriteString(wb.Build)
End Select

--  作者:zhangjian222200
--  发布时间:2017/3/10 21:20:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq20170310211449.png
图片点击可在新窗口打开查看
1.我填写了一个完整的手机号,但是还是提示错误,见上图,点击返回,不能回到注册页面。
2.如果控制手机(输入11位字符)、密码(输入6~10位字符)

注:
注册页面:register.htm
首页:index.htm
[此贴子已经被作者于2017/3/10 21:47:26编辑过]

--  作者:有点蓝
--  发布时间:2017/3/10 22:00:00
--  
Dim wb As New weui
Else
    Dim nms() As String = {"isj","imm","sxb","fuwuxieyi"} \'不能为空的列名数组
    Dim nms2() As String = {"手机","密码","性别","同意协议" }  \'重新定义了nms数组,增加了两列.
    For i As Integer = 0 To nms.Length - 1
        If e.PostValues.ContainsKey(nms(i)) = False Then \'生成错误提示页
            With wb.AddMsgPage("","msgpage","增加失败", nms2(i) & "列不能为空!")
                .icon = "Warn" \'改变图标
                .AddButton("btn1","返回","register.htm")
            End With
            e.WriteString(wb.Build)
            Return "" \'必须返回
        End If
    Next
    Dim num As String = e.PostValues("isj")
    If num > "" AndAlso num.Length <> 11 Then
        With wb.AddMsgPage("","msgpage","增加失败", "手机号码必须为11位!")
            .icon = "Warn" \'改变图标
            .AddButton("btn1","返回","register.htm")
        End With
        e.WriteString(wb.Build)
        Return "" \'必须返回
    End If
    
    Dim psw As String = e.PostValues("imm")
    If psw > "" AndAlso (psw.Length > 10 OrElse psw.Length < 6)  Then
        With wb.AddMsgPage("","msgpage","增加失败", "m密码长度为6~10位!")
            .icon = "Warn" \'改变图标
            .AddButton("btn1","返回","register.htm")
        End With
        e.WriteString(wb.Build)
        Return "" \'必须返回
    End If
    
    Dim dr As DataRow = DataTables("会员资料").AddNew()
    For i As Integer = 0 To nms.Length - 1
        If e.PostValues.ContainsKey(nms(i)) Then
            dr(nms2(i)) = e.PostValues(nms(i))
        End If
    Next
    \'保存并生成增加成功提示页面
    dr.save()
    wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") \'直接跳转到首页
End If
[此贴子已经被作者于2017/3/10 22:00:05编辑过]