This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validations using javascript

 
usha mocherla
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a ".js" file use it in your jsp.
 
usha mocherla
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just wanna say one thing.

doing client-side validation is not bad but never rely on client-side validation.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic