学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

用了VB还能用JAVA吗?

用了VB还能用JAVA吗?

我的添加页面:

<!--#include file="conn.asp"-->
<Script Language="VBScript">
<!--
sub fsubmit()
if trim(form1.news_pic.value)<>"" then
form1.isp.value="1"
End if
form1.submit
End sub
-->
</Script>
<form action="upfile.asp" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="600" border="0" cellspacing="2" cellpadding="0">
    <tr>
      <td width="88">标题</td>
      <td colspan="2"><input name="news_head" type="text" id="news_head" size="61" /></td>
    </tr>
<tr>
      <td>标题图片</td>
      <td colspan="2"><input name="news_pic" type="file" id="news_pic" size="30" /></td>
    </tr>
    <tr>
      <td>详细内容</td>
      <td colspan="2"><textarea name="news_body" cols="60" rows="30" id="news_body"></textarea></td>
    </tr>
    <tr>
      <td> </td>
      <td width="135" align="center"><input type="submit" name="Submit" value="提交" onclick="fsubmit()"/></td>
      <td width="377" align="center"><input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>
<input type="hidden" name="isp" value="">
</form>


如何在上面的代码中 加入

<script language="javascript">
   function Checkform(){
   if(document.form1.news_head.value==""){
     alert("请输入标题!");
         return false;
   } else if (document.form1.news_body.value==""){
     alert("请输入内容!");
         return false;
   } else {
     return true;
        }
}
</script>

呢????

是不是用了 VBScript 就不能用 javascript 呢?( 用个朋友提示说 分块来写,但是我不太明白~请教大家了~)

TOP

我的 form 代码,最下面还有个

<input type="hidden" name="isp" value="">

也就是 我的这个 form 表单 既需要 VBscript 验证(图片是否为空),  也需要 javascript 验证(内容是否为空) ~~

TOP

发新话题