You can use an external file... but so far as I know it must be part of the .XSN to work. The trick is to add it as a resource, and then go into the manifest.xsf file and list it in the xsf:scripts section. Then you can call from script.js to myscript.js.
But this doesn't sound like what you want to do. Although this allows you to have an extra script file, you must still include it as part of the .XSN which means that each form must be updated when the script file changes.
There are some other possibilities I haven't tried yet. If you try them, please let me know how they work.
1. If you have (or can have) a Task Pane, you might be able to load and reference the http:// script file from there and then possibly access it from your form.
2. You might be able to find some way to load it from your script.js file into a DOM, or something else, during OnLoad, and then access the functions in it.
There might be other ways, and I haven't tried either of these. Let us know if you find a way.
--
Greg Collins [InfoPath MVP]
Please visit:
http://www.InfoPathDev.com
Hi
I want to use script files which are shared on another server. How can i use
them on my Infopath form's script ?
Can i include script files as resources of my form ? and if yes, how can i
use them on my code ?
Thx