文本框中只能输入数字的脚本例子2


<%@ page language="java" pageEncoding="GBK"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="b.js"></script>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html140/strict.dtd">
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<title>Sample Page!</title>
</head>
<body>
<br>
<center>
<p>伪URL 地址引入JavaScript 脚本代码实例:</p>
<form name="MyForm">
  <p>电话:
<input onclick="javascript:alert('请输入3位以内的数字')"  onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" maxlength="3">


</p>
  <p>
    <label>
    <input type="submit" name="Submit" value="提交">
    </label>
</p>
</form>
</center>
</body>
</html>

你可能感兴趣的:(java,apache,bean,struts,脚本)