这个js怎么没不能验证呢?纠结<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>后台管理</title>
<link href="/css/manage/admincp.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
/* 验证表单输入项 */
function testNumber()
{
if(!this.isNull()){
for(i=0;i<this.length;i++)
{
if(this.charAt(i)<"0"||this.charAt(i)>"9")
{
return false;
}
}
return true;
}
else
{
return true;
}
}
</script>
</head>
<body >
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth" align="center">
<tr>
<td class="head"> </td>
</tr>
</table><div align="center"> <!--
-->
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth">
<form action="/biaoq/updateBiaoqAction.action" method="post" onSubmit="return testNumber()">
<tr class="head" align="center">
<tr class="header"><td colspan="2">
<input type="button" name="Submit22x" value="更换选择显示其他设置" onClick="window.location=('/biaoq/toInsertBiaoqAction.action')">
<input type="button" name="Submit222" value="查看效果" onClick="window.open('http://localhost')">
<input type="button" name="Submit2222" value="返回频道/专题" onClick="window.location=('http://localhost/')"></td></tr>
</td>
</tr>
<!---->
<tr>
<td bgcolor="#FFFFFF" width="18%">类型:</td>
<td bgcolor="#FFFFFF" width="82%">
<input type="radio" name="biaoq.logintype" value="0" onclick="code('0');" >
横条登录框
<input type="radio" name="biaoq.logintype" value="1" onclick="code('1');" >
方形登录框</td>
</tr>
<!---->
<tr>
<td bgcolor="#FFFFFF" width="18%">调用代码:</td>
<td bgcolor="#FFFFFF" width="82%">
<textarea name="code" cols="80" rows="5" id="jscode"><script language="JavaScript" src="http://localhost/do/hack.php?hack=login&job=js&styletype=0"></script></textarea>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">更新内容时上方遮蔽层设置: </td>
<input type="hidden" name="biaoq.id" value="${biaoq.id }" />
<td bgcolor="#FFFFFF">层宽
<input name="biaoq.wide" type="text" id="wide" value="${biaoq.wide}" size="4" />
层高
<input name="biaoq.high" type="text" id="high" value="${biaoq.high}" size="4" />
层的颜色
<input name="biaoq.color" type="text" id="color" value="${biaoq.color}" size="12" onclick="foreColor_font(this);" />
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">是否隐藏,暂时不显示:</td>
<td bgcolor="#FFFFFF">
<input type="radio" name="biaoq.hide" value="0" checked>
显示
<input type="radio" name="biaoq.hide" value="1" />
隐藏</td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" colspan="2"><label>
<input type="submit" name="Submit" value="提 交" onClick=sub() />
</label>
</td>
</tr>
</form>
</table> <!---->
</div>
<br>
</body>
</html>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>后台管理</title>
<link href="/css/manage/admincp.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
/* 验证表单输入项 */
function testNumber()
{
if(!this.isNull()){
for(i=0;i<this.length;i++)
{
if(this.charAt(i)<"0"||this.charAt(i)>"9")
{
return false;
}
}
return true;
}
else
{
return true;
}
}
</script>
</head>
<body >
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth" align="center">
<tr>
<td class="head"> </td>
</tr>
</table><div align="center"> <!--
-->
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth">
<form action="/biaoq/updateBiaoqAction.action" method="post" onSubmit="return testNumber()">
<tr class="head" align="center">
<tr class="header"><td colspan="2">
<input type="button" name="Submit22x" value="更换选择显示其他设置" onClick="window.location=('/biaoq/toInsertBiaoqAction.action')">
<input type="button" name="Submit222" value="查看效果" onClick="window.open('http://localhost')">
<input type="button" name="Submit2222" value="返回频道/专题" onClick="window.location=('http://localhost/')"></td></tr>
</td>
</tr>
<!---->
<tr>
<td bgcolor="#FFFFFF" width="18%">类型:</td>
<td bgcolor="#FFFFFF" width="82%">
<input type="radio" name="biaoq.logintype" value="0" onclick="code('0');" >
横条登录框
<input type="radio" name="biaoq.logintype" value="1" onclick="code('1');" >
方形登录框</td>
</tr>
<!---->
<tr>
<td bgcolor="#FFFFFF" width="18%">调用代码:</td>
<td bgcolor="#FFFFFF" width="82%">
<textarea name="code" cols="80" rows="5" id="jscode"><script language="JavaScript" src="http://localhost/do/hack.php?hack=login&job=js&styletype=0"></script></textarea>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">更新内容时上方遮蔽层设置: </td>
<input type="hidden" name="biaoq.id" value="${biaoq.id }" />
<td bgcolor="#FFFFFF">层宽
<input name="biaoq.wide" type="text" id="wide" value="${biaoq.wide}" size="4" />
层高
<input name="biaoq.high" type="text" id="high" value="${biaoq.high}" size="4" />
层的颜色
<input name="biaoq.color" type="text" id="color" value="${biaoq.color}" size="12" onclick="foreColor_font(this);" />
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">是否隐藏,暂时不显示:</td>
<td bgcolor="#FFFFFF">
<input type="radio" name="biaoq.hide" value="0" checked>
显示
<input type="radio" name="biaoq.hide" value="1" />
隐藏</td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" colspan="2"><label>
<input type="submit" name="Submit" value="提 交" onClick=sub() />
</label>
</td>
</tr>
</form>
</table> <!---->
</div>
<br>
</body>
</html>
解决方案 »
- 在一个JFramme窗口上弹出一个模态的对话框,父窗口会不可操作。在这种情况下,鼠标在父窗口上移动,我想得到鼠标在父窗口的Pane上的位置!
- innerHTML和frame结合请求?
- 没觉得这个方法有什么用:setOpaque(boolean isOpaque),大家用到过吗?
- Java如何在函数中修改传入参数的值
- 到哪下载包含CachedRowSet的包
- java中如何调用activeX控件?
- 该异常啥意思~
- linux中安装j2sdk
- java能否实现递归调用,入门级问题!!欢迎大家讨论!
- 路老兄(路人甲):关于上传文件,你的回答我找了,但我还没明白,希望你付上源码,不胜感激!!!
- 关于Math类中的一个方法的使用
- (在线等)如何写一个自己的source reader来读自己的数据
改成<input type="submit" name="Submit" value="提 交" onClick=testNumber(); />