• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript in JSP

 
Golla Vensiri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Iam getting "object expected error" when running this JSP file in Tomcat, at the point where i called validateRMDealerContacts(). In the code given below i called validateRMDealerContacts() in th if statement. Can anyone pls help me.

<script language=javascript src="RMDealerContactsValidation.js" type="text/javascript"></script>

<SCRIPT language=Javascript>
function submitForm()
{

if(validateRMDealerContacts())/*This function is there in RMDealerContactsValidation.js */
{

--------
}
}
</SCRIPT>
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(MOVE TO HTML/JavaScript)

Problem is something you are calling is not loaded when the script runs.

Object expected usually coccurs when the element does not exist on the page.

Eric
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Eric requested, I am moving this thread to the HTML/Javascript forum.

Mark
 
Golla Vensiri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

Thanks for u'r suggestion.

iam getting the same when i replace <script language=javascript src="RMDealerContactsValidation.js" type="text/javascript"></script>

tag with jsp include directive tag.
<%@ include file="RMDealerContactsValidation.jsp" %>

i kept the .js files and .jsp files in the same folder

any suggestions??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When is the error occurring and when is the script being called.

I am sure that the JS file is loading from the directory, the problem should be the elements on the page in general.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic