问题描述
- 请教各位大神帮写一个ASP申请表单
-
<div style="margin-left:auto; margin-right:auto;margin-top:0px; width:950px; "> <div id="div0" runat="server" style="line-height:20px;"> <ul> <li style="text-align:center; font-size:16px; padding-top:10px;">申请聊天室协议</li></ul> <ul> <li style="text-align:center;"> <textarea cols="150" name="textarea" rows="17" style="border:0px; font-size:12px;"> <%=show_xy() %> </textarea> </li> </ul> <ul> <li style="text-align:center; height:25px; line-height:25px;"> <asp:CheckBox ID="CheckBox1" runat="server" Checked="false"OnCheckedChanged ="check_Click" /> <asp:Label ID="errmsg" runat="server" ForeColor="red" Text="我同意"></asp:Label></li></ul> <ul> <li style="text-align:center; padding-bottom:10px;"> <asp:Button ID="Button1" runat="server"Text="下一步" OnClick="Button_Click_1" /></li></ul> </div> <div id="Div1" runat="server" visible="false" style="line-height:28px;"> <ul> <li style="text-align:center;font-weight:bold; font-size:16px;">聊天室选项</li></ul> <ul> <li> <div style="float:left;width:465px;line-height:28px;"> <ul> <li class="roomsqli_left">聊天室名:</li><li class="roomsqli_mina"><asp:TextBox ID="roomname" AutoPostBack="true" OnTextChanged="room_onchanger" runat="server" CssClass="input"></asp:TextBox> <span style="color:Red;cursor:pointer;"onclick="javascript:on_roomcheck();">检查</span> <asp:Label ID="yz_roomname" runat="server" Text=""></asp:Label></li><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="roomname" Display="Static" ErrorMessage="*" /> </ul> <ul> <li class="roomsqli_left">房间密码:</li><li class="roomsqli_mina"><asp:TextBox ID="roompass" runat="server" CssClass="input"></asp:TextBox></li><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="roompass" Display="Static" ErrorMessage="*" /> <asp:RegularExpressionValidator ID="_PWS" runat="server" ControlToValidate="roompass" ValidationExpression="^[a-zA-Z0-9_]{6,20}$" ErrorMessage="密码不符要求" Display="Dynamic" /> </ul> <ul> <li class="roomsqli_left">是否购买:</li><li class="roomsqli_mina"> <asp:RadioButtonList ID="ongm" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1">是</asp:ListItem> <asp:ListItem Value="0" Selected="True">否</asp:ListItem> </asp:RadioButtonList> </li> <li class="roomsqli_left">是否自己配置脚本:</li><li class="roomsqli_mina"> <asp:RadioButtonList ID="onjs" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1" Selected="True">是</asp:ListItem> <asp:ListItem Value="0">否</asp:ListItem> </li> </div> <div style="float:left;width:465px;line-height:28px;"> <ul> <li class="roomsqli_left">可容纳人数:</li><li class="roomsqli_mina"> <asp:DropDownList ID="rum" runat="server"> <asp:ListItem Value="30">30人</asp:ListItem> </li> <li class="roomsqli_left">聊天室类型:</li><li class="roomsqli_mina"> <asp:RadioButtonList ID="type" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1">文字</asp:ListItem> </asp:RadioButtonList></li></ul> <ul> <li class="roomsqli_left">选择聊天区:</li><li class="roomsqli_mina"> <asp:DropDownList ID="rid" runat="server"> <asp:ListItem Value="0">聊天区一</asp:ListItem> </asp:DropDownList> </li> <li class="roomsqli_left">聊天室期限:</li><li class="roomsqli_mina"> <asp:DropDownList ID="roomtime" runat="server"> <asp:ListItem Value="1">一年</asp:ListItem> </asp:DropDownList> </li> </ul> </div> </li> <li style="text-align:center; width:948px;"> <div style="border-bottom:#e1e1e1 1px solid; height:10px; margin-bottom:5px;" ></div> </li> <li style="text-align:center; width:948px;"> <span style="font-weight:bold; font-size:16px;">申请人资料</span> </li> <li> <div style="float:left;width:465px;line-height:28px;"> <ul> <li class="roomsqli_left">真实姓名:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtName" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtName" Display="Static" ErrorMessage="*" /> </li> <li class="roomsqli_left">证件号(身份证):</li><li class="roomsqli_mina"> <asp:TextBox ID="txtIDCard" AutoPostBack="true" OnTextChanged="Idcard_onchanger" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtIDCard" Display="Static" ErrorMessage="*" /> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="*" ControlToValidate="txtIDCard"ValidationExpression="d{17}[d|X]|d{15}"></asp:RegularExpressionValidator> <asp:Label ID="Sfzyz" runat="server" Text=""></asp:Label> </li> <li class="roomsqli_left">本站注册名:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtRegName" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtRegName" Display="Static" ErrorMessage="*" /> </li> <li class="roomsqli_left">Email:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtemail" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtemail" Display="Static" ErrorMessage="*" /><asp:RegularExpressionValidator ID="__email" runat="server" ControlToValidate="txtemail" ValidationExpression="w+([-+.']w+)*@w+([-.]w+)*.w+([-.]w+)*" ErrorMessage="格式不对" Display="Static" /> </li> <li class="roomsqli_left">电话号码:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtTel" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtTel" Display="Static" ErrorMessage="*" /> <asp:RegularExpressionValidator ID="__Tel" runat="server" ControlToValidate="txtTel" ValidationExpression="d{3,4}-d{7,8}|d{3,4}?d{7,8}|(d{3,4})?d{7,8}" ErrorMessage="格式不对" Display="Static" /> </li> </ul> </div> <div style="float:left;width:465px;line-height:28px;"> <ul> <li class="roomsqli_left">性别:</li><li class="roomsqli_mina"> <asp:RadioButtonList ID="sex" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1" Selected="True">男</asp:ListItem> <asp:ListItem Value="2">女</asp:ListItem> </asp:RadioButtonList> </li> <li class="roomsqli_left">住址:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtAdd" runat="server" Width="200" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="txtAdd" Display="Static" ErrorMessage="*" /> </li> <li class="roomsqli_left">本站注册名密码:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtRegpass" runat="server" TextMode="Password" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="txtRegpass" Display="Static" ErrorMessage="*" /> </li> <li class="roomsqli_left">QQ号:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtQq" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="txtQq" Display="Static" ErrorMessage="*" /> <asp:RegularExpressionValidator ID="_qq" runat="server" ControlToValidate="txtQq" ValidationExpression="^[0-9]{4,9}$" ErrorMessage="QQ号不符要求" Display="Static" /> </li> </ul> <ul> <li class="roomsqli_left">移动电话:</li><li class="roomsqli_mina"> <asp:TextBox ID="txtYdtel" runat="server" CssClass="input"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="txtYdtel" Display="Static" ErrorMessage="*" /> <asp:RegularExpressionValidator ID="__Yd" runat="server" ControlToValidate="txtYdtel" ValidationExpression="13[0-9]{9}|15[0-9]{9}|19[0-9]{9}" ErrorMessage="格式不对" Display="Static" /> </li> </div> </li> <li style="text-align:center; width:948px;"> <div style="border-bottom:#e1e1e1 1px solid; height:10px; margin-bottom:5px;" ></div> </li> <li style="text-align:center; width:948px; color:Red;"> 注意:以上资料将被保存。你的IP也会被记录,本站只把申请人的资料作为备案,不会泄露出去。 </li> <ul> <li style="text-align:center; width:948px;"> <asp:Button ID="ButSq" runat="server" Text="我要申请" OnClick="room_sqOK" /> </li> </ul> <ul> <li style="text-align:center; width:948px;"> <asp:Label ID="Message" runat="server" ForeColor="red" Text=""></asp:Label> </li> </div> <div id="Div2" style="width:940px; height:60px;" runat="server" visible="false"> <li style="text-align:center; height:40px; line-height:40px;"><asp:Label ID="sqover" runat="server" Text=""></asp:Label></li> </ul> </div> </div> </div> <script language="javascript" type="text/javascript"> function on_roomcheck() { var str=document.getElementById("aspnetForm").ctl00_ContentPlaceHolder1_roomname; if(str.value.length==0){ alert("请输入聊天室名再检查!"); str.focus(); return false; } else { var xmlHttp; if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); if (xmlHttp.overrideMimeType) { xmlHttp.overrideMimeType("text/xml"); } } else if (window.ActiveXObject) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } if (!xmlHttp) { window.alert("你的浏览器不支持创建XMLhttpRequest对象"); } xmlHttp.open("POST","checkroom.aspx?name="+escape(str.value),false); xmlHttp.send(); var checks=unescape( xmlHttp.responseText); if (checks=="1") { alert ("欢迎光临聊!nn【"+str.value+"】名字已经被申请,请换别的名字!"); str.value=""; str.focus(); } else { alert ("欢迎光临聊!nn【"+str.value+"】可以申请!"); } return true; } } </script>
时间: 2025-01-02 13:17:23