it could be possible that ur javascript is running before the entire form
has loaded(that means sent to the user and parsed into the browser)...

make sure that its not so...

also check out the netscape dev site for javascript documentation...,

One more thing... when u get the final output(total.jsp => html source at
client)... view the source and try to debug the javascript... as if it were
a standard html file...

might help u bypass the compilation system... to check if there is any
javascript errors

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED] Behalf Of Edward King
Sent: Tuesday, February 18, 2003 7:30 PM
To: [EMAIL PROTECTED]
Subject: errors In run my jsp


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

===========================================================================
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

Reply via email to