• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

validations using javascript

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic