File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes validations using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "validations using javascript" Watch "validations using javascript" New topic
Author

validations using javascript

usha mocherla
Ranch Hand

Joined: Sep 24, 2004
Posts: 33
hi
i have n number of jsp pages.
for the validation of all i want to write single javascript file tht can be included in all jsps.
is it possible?
if yes,plz letme knw
thanx in advance
regards
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Use a ".js" file use it in your jsp.


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
usha mocherla
Ranch Hand

Joined: Sep 24, 2004
Posts: 33
thanx
but for every form i'll have to write ".js" which i want to avoid.i want only single ".js" tht can be included anywhere in every form.
it shld be global.
regards
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Originally posted by usha mocherla:
thanx
but for every form i'll have to write ".js" which i want to avoid.i want only single ".js" tht can be included anywhere in every form.
it shld be global.
regards

Thats wat i said usha.
Just write a ".js" file and include it where ever you need.

Like this <script language="JavaScript" src="scripts/Trim.js"></script>
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
just wanna say one thing.

doing client-side validation is not bad but never rely on client-side validation.
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Originally posted by adeel ansari:
just wanna say one thing.

doing client-side validation is not bad but never rely on client-side validation.


I even agree adeel's statement . particularly on date related stuffs
[ November 09, 2004: Message edited by: srini vasan ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61430
    
  67

Moving to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Usha,

Well....

You can do it with a single ".js" file and call the file from all the
pages in the application...

The Syntax goes as follows.

Say you have a javascript function, like



And you like to call this function from all the pain your application,
say [QB]onClick()[\QB] of a button.

The way to call the ".js" file from any page in the application is



And This file is now accessible to the page.

Now the function validate() can be called as and When required

Hope this helps...

Cheers,
Swamy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validations using javascript