一小段java代码转化为vbscript代码
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("ÇëÊäÈëÐÕÃû£¨»òÃû×Ö¹ý³¤£©£¡")
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
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>转化为 >p<
- 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 代码转化问题




