sedit.asp

来自「《动态网页设计基础教程》,胡杰,科学出版社」· ASP 代码 · 共 240 行

ASP
240
字号
<html>

<head>
<link rel="stylesheet" href="comCSS.css">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>学生信息注册与修改</title>
<base target="rbottom">
<meta name="Microsoft Border" content="t, default">
</head>

<body><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>

<p align="left"> </p>

</td></tr><!--msnavigation--></table><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><!--msnavigation--><td valign="top">
<!-- #include file="adoconn.asp" -->
<% 
Dim LocalArray

IF Session("EditFlag")="MODIFY" THEN 
 LocalArray=Session("DataArray")
ELSE
 Session("EditFlag")="INSERT"
 Redim LocalArray(30)
 Session("Scollege")=Request.form("D1")
End If 

listItem("select ClassNo from ClassNo where College='" & Session("Scollege") & "'" )

%>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.T1.value == "")
  {
    alert("请在 T1 域中输入值。");
    theForm.T1.focus();
    return (false);
  }

  if (theForm.T1.value.length < 1)
  {
    alert("在 T1 域中,请至少输入 1 个字符。");
    theForm.T1.focus();
    return (false);
  }

  if (theForm.T1.value.length > 11)
  {
    alert("在 T1 域中,请最多输入 11 个字符。");
    theForm.T1.focus();
    return (false);
  }

  if (theForm.T2.value == "")
  {
    alert("请在 T2 域中输入值。");
    theForm.T2.focus();
    return (false);
  }

  if (theForm.T2.value.length > 8)
  {
    alert("在 T2 域中,请最多输入 8 个字符。");
    theForm.T2.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.T4.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("在 T4 域中,只能输入 数字 个字符。");
    theForm.T4.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="Swrite.ASP" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1" >   
<p align="center"><b><font face="华文彩云" size="5">学生信息注册</font></b></p>
<table border="1" width="749" bordercolorlight="#000080" bordercolordark="#000000" height="209">
  <tr>
    <td width="195" height="28"><font face="宋体" size="2">学&nbsp;&nbsp;&nbsp;     
      号:<!--webbot bot="Validation" B-Value-Required="TRUE"
      I-Minimum-Length="1" I-Maximum-Length="11" --><input type="text" name="T1" value="<%=Localarray(0)%>" size="12" style="background-color: #C0C0C0; border-style: inset" maxlength="11"><font color="#FF0000">*</font></font></td>
    <td width="263" height="28"><font face="宋体" size="2">姓&nbsp;&nbsp;&nbsp;     
      名:<!--webbot bot="Validation" b-value-required="TRUE"
      i-maximum-length="8" --><input type="text" name="T2" value="<%=Localarray(1)%>" size="10" style="background-color: #C0C0C0; border-style: inset" maxlength="8"><font color="#FF0000">*</font></font>                   
    </td>               
  </tr>               
  <tr>               
    <td width="195" height="3"><font face="宋体" size="2">性&nbsp;&nbsp;&nbsp;别:          
       <% if localarray(2)="男" or localarray(2)="女" then %>
       <input type="radio" value="男" <%if localarray(2)="男" then %> checked <%end if %> name="R1">男&nbsp;&nbsp;                            
       <input type="radio" value="女" <%if localarray(2)="女" then %> checked <%end if %> name="R1">女</font>
       <%else%>   
       <input type="radio" value="男"  checked  name="R1">男&nbsp;&nbsp;                             
       <input type="radio" value="女"  name="R1">女           
       <%end if%>
    </td>
    <td width="271" height="3"><font face="宋体" size="2">出生年月: 
        <select size="1" name="D1">                                                  
        <% if  Localarray(3)<>"" then %>  
        <option selected><%=left(cstr(Localarray(3)),4)%></option>   
        <%end if %>  
        <%for y=1975 to 2000 %>  
        <option><%=(y)%></option> 
        <%next%>  
        </select>年<select size="1" name="D2">
        <% if  localarray(3)<>"" then %>    
        <option selected><%=mid(Localarray(3),6,2)%></option> 
        <%end if %>  
        <%for m=1 to 12 
         if m<10 then %> 
         <option><%=("0"&m)%></option>      
         <%else%>    
         <option><%=(m) %></option>     
        <%end if %>     
        <%next%>                                     
        </select>月<select size="1" name="D3">
        <% if  Localarray(3)<>"" then %>
         <option selected><%=mid(Localarray(3),9,2)%></option>
         <%end if %>  
        <%for d=1 to 31      
          if d<10 then %>     
        <option><%=("0"&d)%></option>      
          <%else %>                                     
        <option><%=(d) %></option>     
          <%end if %>        
        <%next%>                                    
      </select>日</font>  
    </td>                                             
  </tr>                                             
  <tr>                                             
      <td width="195" height="1"><font face="宋体" size="2">
           口&nbsp;&nbsp;&nbsp;令:           
      <input type="password" name="T3" value="<%=Localarray(4)%>" size="10" style="background-color: #C0C0C0; border-style: inset" maxlength="6"></font></td>                                
      <td width="263" height="1"><font face="宋体" size="2">身份证号:<!--webbot
        bot="Validation" S-Data-Type="Integer" S-Number-Separators="x" --><input type="text" name="T4" value="<%=Localarray(5)%>" size="20" style="background-color: #C0C0C0; border-style: inset"></font></td>                                            
  </tr>                                            
  <tr>        
    <td width="195" height="6"><font face="宋体" size="2">班&nbsp;&nbsp;&nbsp;   
      级:<select size="1" name="D4">
      <option selected><%=Localarray(7)%></option>
      <% for recordi=0 to Itemcount-1%>                           
      <option><%=ItemArray(0,recordi)%></option>                           
      <%next%>                           
    </select><font color="#FF0000">*</font></font></td>           
    <td width="263" height="6"><font face="宋体" size="2">入学时间:&nbsp;       
    <select size="1" name="D5" >
    <%if Localarray(8)<>"" then%>   
    <option selected><%=left(Localarray(8),4)%></option> 
    <%end if%>       
        <%for y=1980 to 2000 %>      
        <option><%=(y)%></option>                                      
        <%next%>     
      </select>年      
    <select size="1" name="D6">
    <%if localarray(8)<>"" then%>     
         <option selected><%=mid(Localarray(8),6,2)%></option>  
    <%end if %>     
        <%for m=1 to 12 
          if m<10 then %>    
           <option><%=("0"&m)%></option>   
            <%else %>       
           <option><%=(m) %></option>  
           <%end if %>    
        <%next%> 
        </select>月 <select size="1" name="D7">     
     <%if localarray(8)<>"" then%>       
        <option selected><%=mid(Localarray(8),9,2)%></option> 
        <%end if %>    
        <%for d=1 to 31 
         if d<10 then %>   
          <option><%=("0"&d)%></option>     
          <%else%>        
          <option><%=(d) %></option>    
          <%end if %>    
        <%next%>  
         </select>日</font>      
    </td>         
  </tr>         
  <tr>         
    <td width="357" colspan="2" height="25"><input type="submit" value="保存" name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <a href="javascript:history.back(1)">返回</a>                      
    </td>         
  </tr>         
</table>         
            
            
</form>      

&nbsp;<font color="#FF0000">*</font> 标注项必填<!--msnavigation--></td></tr><!--msnavigation--></table></body>                      
</html>         
         
         
         
         
     
   
   
  
  
  
  
  
  
  
  
 
 








⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?