I have a question ,this question puzzled me for a long time. I put a Javascript in my
JSP file.But this Javascript raise errors.My structure is a bit complicated. I have a
jsp file named total.jsp,it includes three JSP file. one JSP file "body.jsp" contains
JavaScript.My purpose is to run total.jsp first,and from total.jsp,I run body.jsp,so I
can run my JavaScript in it.But when I run it,it raise errors:
line:10
error:document.newUserForm is not object
Why raise this error? Please help me.My files are follows:
total.jsp
-----------
| title.jsp |
| body.jsp |
| foot.jsp |
-----------
/*total.jsp*/
<html>
<head>
<title>total</title>
</head>
<body>
<%@ include file="title.jsp" %>
<%@ include file="body.jsp" %>
<%@ include file="foot.jsp" %>
</body>
</html>
/*title.jsp*/
<p>This is title jsp</p>
/*foot.jsp*/
<p>This is foot jsp</p>
/*foot.jsp*/
<%@ page contentType="text/html" %>
<script language="JavaScript">
function trans()
{
document.newUserForm.submit();
}
</script>
<body>
<form method="post" action="addUser.jsp" name="newUserForm">
<p>
<input type="button" name="Submit" onclick="trans()">
</form>
Thanks in advance
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com