CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

一小段java代码转化为vbscript代码

楼主noallasp()2001-06-13 18:29:00 在 Web 开发 / ASP 提问

if   document.input.issend.value=document.input.txttitle.value   then    
        response.write   "已发表"  
  else    
        document.input.issend.value=document.input.txttitle.value  
  end   if  
   
  转化为vbs代码! 问题点数:20、回复次数:11Top

1 楼BrentIvan(Ivan)回复于 2001-06-13 18:32:00 得分 0

这是java代码吗?Top

2 楼hydnoahark(诺亚方舟)回复于 2001-06-13 18:49:00 得分 20

看不懂!!!Top

3 楼noallasp()回复于 2001-06-13 19:15:00 得分 0

input应该是一个表单名吧  
  issend   和txttitle是一输入框.  
  或情况如下:  
      在表单input中有   <input   type="text"   name="txttitle">      
      和<input   type="hidden"   name="isSend"   value="">  
      判断txttitle中的值与issend的值是否相等,如相等则不保存,  
      不等的话就对issend进行赋值。  
  上面那段代码是从一个页面上copy下来  
   
      应如何判断呢?  
  Top

4 楼hydnoahark(诺亚方舟)回复于 2001-06-13 19:23:00 得分 0

如果照你说的,应该是客户端的脚本,那怎么会有response.write???  
  if...then...end   if本来就是vbs吧,需要转换吗?Top

5 楼noallasp()回复于 2001-06-13 21:00:00 得分 0

哦   错了,错了,对不起,是我错了。  
  源程序如下:  
  <script   LANGUAGE="javascript">  
  <!--  
  function   input_onsubmit()    
  {  
  if(document.input.username.value=="")  
      {  
        alert("请输入姓名(或名字过长)!")  
        document.input.username.focus()  
        return   false  
      }  
  if((document.input.subject.value=="")   ||   (document.input.subject.value.length>255))  
      {  
        alert("请输入主题(或主题过长)!")  
        document.input.subject.focus()  
        x=0  
        return   false  
      }  
  else  
  {  
      if   (document.input.body.value.length>16000)  
        {  
            alert("内容过长!")  
            document.input.body.focus()  
            return   false  
        }  
      else  
        {  
  if   (document.input.isSend.value==document.input.subject.value)  
        {  
            alert("该主题你已经发送!")  
            return   false  
        }  
        else  
        {  
          document.input.isSend.value=document.input.subject.value  
          return   true  
        }  
  }  
  }  
  }  
   
  //-->  
  </script>  
  请把上面的这段转为vbs。  
   
  Top

6 楼hydnoahark(诺亚方舟)回复于 2001-06-13 21:09:00 得分 0

<script   LANGUAGE="vbscript">  
  <!--  
  function   input_onsubmit()  
  input_onsubmit=false  
  if   document.input.username.value=""   then  
  msgbox("&Ccedil;&euml;&Ecirc;&auml;&Egrave;&euml;&ETH;&Otilde;&Atilde;&ucirc;&pound;¨&raquo;ò&Atilde;&ucirc;×&Ouml;&sup1;&yacute;&sup3;¤&pound;&copy;&pound;&iexcl;")  
  document.input.username.focus()  
  exit   function  
  end   if  
   
  if   document.input.subject.value=""   or   document.input.subject.value.length>255   then  
       
  msgbox("&Ccedil;&euml;&Ecirc;&auml;&Egrave;&euml;&Ouml;÷&Igrave;&acirc;&pound;¨&raquo;ò&Ouml;÷&Igrave;&acirc;&sup1;&yacute;&sup3;¤&pound;&copy;&pound;&iexcl;")  
  document.input.subject.focus()  
  x=0  
   
  else  
   
  if   document.input.body.value.length>16000   then  
       
  msgbox("&Auml;&Uacute;&Egrave;&Yacute;&sup1;&yacute;&sup3;¤&pound;&iexcl;")  
  document.input.body.focus()  
   
  else  
       
  if   document.input.isSend.value=document.input.subject.value   then  
  msgbox("&cedil;&Atilde;&Ouml;÷&Igrave;&acirc;&Auml;&atilde;&Ograve;&Ntilde;&frac34;&shy;·&cent;&Euml;&Iacute;&pound;&iexcl;")  
  else  
      document.input.isSend.value=document.input.subject.value  
  input_onsubmit=false  
  end   if  
  end   if  
  end   if  
  end   function  
  //-->  
  </script>  
  Top

7 楼hydnoahark(诺亚方舟)回复于 2001-06-13 21:12:00 得分 0

汉字变乱码了,再贴一次:  
  <script   LANGUAGE="vbscript">  
  <!--  
  function   input_onsubmit()  
  input_onsubmit=false  
  if   document.input.username.value=""   then  
  msgbox("请输入姓名(或名字过长)!")  
  document.input.username.focus()  
  exit   function  
  end   if  
   
  if   document.input.subject.value=""   or   document.input.subject.value.length>255   then  
       
  msgbox("请输入主题(或主题过长)!")  
  document.input.subject.focus()  
  x=0  
   
  else  
   
  if   document.input.body.value.length>16000   then  
       
  msgbox("内容过长!")  
  document.input.body.focus()  
   
  else  
       
  if   document.input.isSend.value=document.input.subject.value   then  
  msgbox("该主题你已经发送!")  
  else  
      document.input.isSend.value=document.input.subject.value  
  input_onsubmit=false  
  end   if  
  end   if  
  end   if  
  end   function  
  //-->  
  </script>  
  Top

8 楼noallasp()回复于 2001-06-14 11:50:00 得分 0

谢谢。不过请看如下二段代码.为什么会提示不是对象出错呢?  
  test.asp,源程序如下:  
  <HTML>  
  <HEAD>  
  <TITLE>   New   Document   </TITLE>  
  </HEAD>  
  <BODY   BGCOLOR="#FFFFFF">  
  <script   LANGUAGE="javascript">  
  <!--  
  function   input_onsubmit()    
  {  
  if   (document.input.isSend.value==document.input.subject.value)  
        {  
            alert("该主题你已经发送!")  
            return   false  
        }  
        else  
        {  
          document.input.isSend.value=document.input.subject.value  
          return   true  
        }  
  }  
  //-->  
  </script>  
  <form   method="post"   action="vbs.asp"   name="input"   onsubmit="return   input_onsubmit()">  
  <input   type="text"   name="subject"   value="我谁">  
  <input   type="hidden"   name="issend"   value=""   >  
  <input   type="submit"   name="">  
  </form>  
  </BODY>  
  </HTML>  
   
   
  vbs.asp源程序如下。  
  <HTML>  
  <HEAD>  
  <TITLE>Document</TITLE>  
  </HEAD>  
   
  <BODY   BGCOLOR="#FFFFFF">  
  看看行不?  
  </BODY>  
  </HTML>  
   
  可以给贴子加分。Top

9 楼hydnoahark(诺亚方舟)回复于 2001-06-14 12:09:00 得分 0

在javascript中大小写是不同的  
  >><input   type="hidden"   name="issend"   value=""   >  
   
  document.input.isSend.value   =>>   document.input.issend.value    
   
   
  Top

10 楼noallasp()回复于 2001-06-14 12:35:00 得分 0

哈哈,原来是这样的,  
   
  谢谢   hydnoahark(诺亚方舟),你真传大。呵呵Top

11 楼noallasp()回复于 2001-06-14 12:36:00 得分 0

什么没地方给分?Top

相关问题

  • 将C++源代码转化为Java代码的技术
  • dephi代码转化为.net代码
  • 请高手帮忙,如何把下面的VB代码转化成java代码?是有关加密的问题
  • JAVA如何转化HTML tag为可显示代码?如:将<p>转化为 &gt;p&lt;
  • C#代码转化成vb
  • 代码转化问题
  • 请各位高手帮忙,把下面这段VB转化成java代码
  • 求文本字符串转化为二进制流stream的算法代码,javascript或者vbscript均可
  • http://www.ddtong.com/Sql.pl?nId=871609&csId=340387&cName=%bd%af%d3%ee%d6%c7,name如何转化成中文(直接java代码)
  • windows 和linux 代码转化问题

关键词

得分解答快速导航

  • 帖主:noallasp
  • hydnoahark

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo