NET移植案例学习:建造Web站点(7)

2016-01-29 19:21 1 1 收藏

NET移植案例学习:建造Web站点(7),NET移植案例学习:建造Web站点(7)

【 tulaoshi.com - ASP 】

    图5 客户端的验证逻辑

FormSubmitTest(problemTitle,bugDescription,buildVersion,cboProduct,
appLanguage,cboArea, cboSubArea,severity,build)
{
 var iG;
 var renl = "r" + "n";
 iG = 0;
 ResetArrowSize();
 if (problemTitle.value == "" ){ 
  document.images.item("ArrowProbTitle").width=8
  iG++
  }
 if (buildVersion.value == -1){
  document.images.item("ArrowBuildVersion").width=8
  iG++
 }
 if (buildVersion.value == ""){
  document.images.item("ArrowBuildVersion").width=8
  iG++
 }
 if (appLanguage.value == -1){
  document.images.item("ArrowAppLanguage").width=8
  iG++
 }
 if (cboProduct.value == ""){
  document.images.item("ArrowProductName").width=8
  iG++
 }
 if (cboArea.value == ""){
  document.images.item("ArrowProblemArea").width=8
  iG++
 }
 if (cboSubArea.value == ""){
  document.images.item("ArrowProblemSubArea").width=8
  iG++
 }
 if (severity.value == -1){
  document.images.item("ArrowSeverity").width=8
  iG++
 }
 if (bugDescription.value == "Problem Description:" + renl + renl + 
     "Steps to reproduce:" + renl + renl + "Expected behavior:" 
     + renl + renl + "Actual behavior:"+ renl + renl + renl){ 
  document.images.item("ArrowDescription").width=8
  iG++
 }
 if (bugDescription.value == ""){
  document.images.item("ArrowDescription").width=8
  iG++
 }
 if (iG != 0){
  alert("You are missing one or more of the required items 
     (indicated by the red arrow) needed to submit this form.")
  return false;
 }
 else{
  if (document.form1.bugDescription.value == "")
  {
   // don't submit
   alert("Please enter a problem description.")
   return false;
  }
 else{
  if (document.form1.bugDescription.value == "Problem 
     Description: 
     Steps to reproduce: Expected behavior: Actual 
     behavior:")
   {
    // don't submit
    alert("Please enter a problem description.")
    return false;
   }
  else{
   var buildval = build.value;
   var buildlen = buildval.length;
   file://alert(buildlen);
   if (buildlen <= 0)
   {
    var typ = buildVersion.type;
    if (typ == "text") file://build is a text box
    {
     var val = buildVersion.value;
     var len = val.length;
     if ((isNaN(val)) || (len != 4))
     {
      // don't submit
      alert("Please enter 'Build' using the 
         format 'NNNN'.")
      return false;
      }
    else
    {
     // concatenate the build number with 
      "07.00.00."
     buildVersion.value = "07.00.00." + 
     buildVersion.value
     // submit
     document.form1.method = "POST"
     document.form1.action = "lamegeneral.asp" 
     return true;
     }
    }
   else
   {
    // subm

来源:https://www.tulaoshi.com/n/20160129/1509138.html

延伸阅读
标签: Java JAVA基础
  JSP是由Sun微系统公司于1999年6月推出的一项技术,是基于JavaServlet以及整个java体系的Web开发技术,利用这一技术可以建立先进、安全和跨平台的动态网站。 JSP 与ASP非常相似。两者都提供在HTML 代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。在ASP或JSP 环境下,HTML代码主要负责描述信息的显示样式,而程序代码则用来...
using System; class EnumExample { public enum TimeOfDay :int { Morning=0, Afternoon=1, Evening=2 } public static int Main() { WriteGreeting(TimeOfDay.Morning); return 0; } static void WriteGreeting(TimeOfDay timeOfDay) { switch(timeOfDay) { case TimeOfDay.Morning: Console.WriteLine("Good morning!"); bre...
标签: ASP
       为什么需要Web Service       在通过internet网购买商品后,你可能对配送方式感到迷惑不解。经常的情况是因配送问题找配送公司而消耗你的大量时间,对于配送公司而言这也不是一项增值服务。       为了解决这种问题,配送公司需要在不降低安全级别的...
标签: ASP
          创建Web Service       我将用c#创建一个Web Service 叫SecurityWebService。一个Web Service文件的扩展名是:.asmx(就象asp.net的文件扩展名.aspx那样),文件的第一行是:      <%@ WebService Language="C#" class="SecurityWebSe...
标签: ASP
          怎样使用Web Service       现在我们能够使用这个Web Service了,让我们输入一个值获得一个假的价格。             点击Invoke按钮,将显示一个下面这样的新窗口和Xml文档。       &nbs...

经验教程

817

收藏

32
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部