Greetings,

On reflection I have decided I was unclear in my last post so I thought I should have another go at it.

I have written an external script, located in validateform.js, that validates the information on a form. I have a second external script, date.js, that validated dates. I would like to call a function in dates.js from validateform.js but for the life of me I cannot figure out how.

Thanks again,

Jeff

Recommended Answers

All 4 Replies

Greetings,

On reflection I have decided I was unclear in my last post so I thought I should have another go at it.

I have written an external script, located in validateform.js, that validates the information on a form. I have a second external script, date.js, that validated dates. I would like to call a function in dates.js from validateform.js but for the life of me I cannot figure out how.

Thanks again,

Jeff

body onload?

body onload?

I'm not quire sure what you mean.

well u can trigger a function with the <body onload="">
</body>

tag i assume u would put it in the external script but make it php? to call the other one?

as long as the scripts are in the <head> before any script is called, the scripts in a are available to b
they can be called just by calling their names

consider combining these separate scripts into one, since overhead in downloading separate small files is often more than the files themselves

in b if validating dates on submssion using a function val_date()
just type a line
val_date();
in the submission validate javascript

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.