This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP not calling JS file funtion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Bookmark "JSP not calling JS file funtion" Watch "JSP not calling JS file funtion" New topic

JSP not calling JS file funtion

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
I gus

I have a simple Javascript (.js) file with some client validation for the registration details of users on my site.
The problem is, the JSP doesn't call the Javascript function on 'submit.

The JSP looks like this:

And the Javascipt file is under glassfish: <app>/<war>/javascript/reg_validation.js

Any help?


ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403

Src path for javascript seems ok. Are you getting any error on your browser (yellow exclamation mark under baseline left of your screen). Can you post your contents for js file ? Which browser are you using for this ?

Ujjwal B Soni <baroda, gujarat, india> <+918866008962>
"Helping hands are better than praying lips......"
David Newton

Joined: Sep 29, 2008
Posts: 12617

Is the JS file *in* the war?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63196

The URL for the script file is likely missing the context path.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Thanks for the help guys, check my 'stoopid' typo:

# password: <input type="text" name="password" id="pwd" value="" />

password & pwd?

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JSP not calling JS file funtion
It's not a secret anymore!