| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 445 人关注过本帖
标题:submit
只看楼主 加入收藏
mako
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2006-8-1
收藏
 问题点数:0 回复次数:6 
submit

<!--#Include file="Inc/conn.asp"-->
<html>
<head>
<script language = "JavaScript">
<!--
function check()
{
if (document.Form1.parent.value == "")
{
alert("请填写文章类别");
document.Form1.parent.focus();
return (false);
}
if (document.Form1.title.value == "")
{
alert("请输入文章标题!");
document.Form1.title.focus();
document.Form1.title.select();
return (false);
}

if (document.Form1.author.value == "")
{
alert("请填写作者!");
document.Form1.author.focus();
return (false);
}

var filter=/^\s*[.A-Za-z0-9_-]{4,15}\s*$/;
if (!filter.test(document.Form1.author.value))
{
alert("用户名填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 _ - .)长度不小于4个字符,不超过15个字符,注意不要使用空格。");
document.Form1.author.focus();
document.Form1.author.select();
return (false);
}

if (document.Form1.content.value == "")
{
alert("请输入文章内容!");
document.Form1.content.focus();
document.Form1.content.select();
return (false);
}

if (document.Form1.Content.value.length>655360)
{
alert("文章内容太长,超出了ACCESS数据库的限制(640K)!建议将文章分成几部分录入。");
document.Form1.content.focus();
document.Form1.content.select();
return false;
}

document.Form1.submit()
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="img/makov1.css" type="text/css" rel="stylesheet">
</head>
<title>mako测试站点-后台编辑</title>
<body>
<!--#include file="Inc/top.asp"-->
<form method="POST" name="Form1" action="ArticleSave.asp">
<table width="786" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td height="40" colspan="2" align="center"><span class="text3"><strong>mako website 1.0</strong></span></td>
</tr>
<tr>
<td width="148"><P style="MARGIN-TOP: 2px; MARGIN-LEFT: 80px">所属类别:</p></td>
<td width="630"><input name="parent" type="text" id="parent"></td>
</tr>
<tr>
<td><P style="MARGIN-TOP: 2px; MARGIN-LEFT:80px">文章标题:</p></td>
<td><input type="text" name="title" size=60></td>
</tr>
<tr>
<td><P style="MARGIN-TOP: 2px; MARGIN-LEFT: 80px">录入作者:</p></td>
<td><input type="text" name="author"></td>
</tr>
<tr>
<td valign="top"><P style="MARGIN-TOP: 5px; MARGIN-LEFT: 80px">文章内容:</p></td>
<td><textarea name="content" cols="90" rows="25"></textarea></td>
</tr>
<tr align="center">
<td colspan="2">
<input onClick="check()" type="button" name="button" value="添加文章">
<input type="reset" name="Submit" value="重填"></td>
</tr>
</table>
</form>
<br>
<br>
<br>
</body>
</html>
----------------------------------------------
添加文章页面,检查可以,但是为什么就不能提交呢?

搜索更多相关主题的帖子: submit 
2006-08-16 15:02
mako
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2006-8-1
收藏
得分:0 
渚薰

2006-08-16 15:21
mako
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2006-8-1
收藏
得分:0 
帮帮偶啊//////////////

2006-08-16 15:39
mako
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2006-8-1
收藏
得分:0 
为什么没有帮助

2006-08-16 16:27
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
if (document.Form1.Content.value.length>655360)
{
alert("文章内容太长,超出了ACCESS数据库的限制(640K)!建议将文章分成几部分录入。");
document.Form1.content.focus();
document.Form1.content.select();
return false;
}
-------------------------------------
以上是你写的 问题就出在这 把这些代码删掉就能够提交了
你判断的不对 自己改改吧

其实我很低调,只是你不知道...
2006-08-16 17:18
seal520_2008
Rank: 1
等 级:新手上路
帖 子:239
专家分:0
注 册:2006-6-13
收藏
得分:0 
if (document.Form1.Content.value.length&gt;655360)
  {
    alert("文章内容太长,超出了ACCESS数据库的限制(640K)!建议将文章分成几部分录入。");
    document.Form1.content.focus();
    document.Form1.content.select();
    return false;
  }

代码中的Content C改成小写的c js中区分大小写的

每晚0:00上线 msn:seal520_2008@ myblog:http://seal.
2006-08-16 17:23
mako
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2006-8-1
收藏
得分:0 
谢谢,问题解决,结帖

2006-08-16 19:10
快速回复:submit
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018752 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved