dcsimg
How to make use of the same Javascript file for different forms with different number of elements??
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Padma_Sridhar
Posted On:   Wednesday, April 11, 2001 08:52 PM

How to make use of the same Javascript file which has a function to check the elements for null value or valid email id etc for different forms which have different number of elements? Each html file has got few forms with different number of elements. How do I call the function & how to return the values.Suppose the field is not filled I should get the alert message & the cursor should point to that particular field

Re: How to make use of the same Javascript file for different forms with different number of elements??

Posted By:   Vasu_Devan  
Posted On:   Wednesday, April 11, 2001 10:38 PM

If you want the same function to be used across many html files, put the function in a file, say func.js and in the htmls where you want use it, include it using,









or, if you want to use the same function for different elements which may have different names, you can pass the element to the function using 'this'.