Link to an external script file - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Link to an external script file

Last post 02-28-2005 02:28 PM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-17-2005 04:37 PM

    Link to an external script file

    Guys & Gals,

    I am programming in JScript.

    I have the script.js file with various events in it that InfoPath provides. There are common functions I wish to envoke that I'd like to store in another file (myscript.js). I have created myscript.js and added it as resource in InfoPath.

    Q. If myscript.js has a function (saveMyFile(XDocument)) - how can I call it from within my event code help in script.js

    Many thanks,
    Matthew.
  • 02-22-2005 03:11 PM In reply to

    Re: Link to an external script file

    You cannot point to an "External" script file, BUT you can have a common script file that does NOT need to be pasted into your script.js file. The basic steps are as follows:

    1. Create your aux. script file.
    2. Add your aux. script file as a resource.
    3. Extract form files, and then edit the manifest.xsf.
    4. Locate the <xsf:scripts> block, and then add your aux. script file to the list.
    NOTE: If you don't find the xsf:scripts file, then you haven't actually created script.js yet.

    Now you can access functions from the aux. script file as if they were internal to script.js.
    Granted, this still is not a shared script file, but its a whole lot closer than what you've been doing.


    Greg Collins [InfoPath MVP]
  • 02-27-2005 10:24 PM In reply to

    Re: Link to an external script file

    Greg, many thanks for your suggestions - I've tried it and it works like a charm.

    Regards,
    Matthew
    Telstra Australia
  • 02-28-2005 02:28 PM In reply to

    Re: Link to an external script file

    Glad to hear you got it working!!

    Greg Collins [InfoPath MVP]
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.