Using JS - InfoPath Dev
in

InfoPath Dev

Using JS

Last post 04-09-2006 08:14 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-09-2006 12:21 PM

    • sagiw
    • Not Ranked
    • Joined on 03-31-2006
    • Posts 10

    Using JS

    Hello, how are you?
    I wanted to knoe how can I insert information do a text box field using JS?
    Is it something like this?
    XDocument.field1.value="text";
    ?

    Thank you
  • 04-09-2006 08:14 PM In reply to

    Hi Sagiw and welcome to our forum!

    InfoPath comes with 25 out-of-box samples that include lots of JS. To access the script.js files for them, start InfoPath and choose Sample Forms (under Form Categories). Select one of the forms and click Design This Form in the left taskpane. For example, Service Request. Now, click File->Extract Form Files and create a new folder somewhere where you can extract the files. Navigate to that folder in Windows Explorer. Right click on script.js file and choose open with Notepad. Search for Common Form Template Functions and copy everything from that comment down into the script.js file that you are using for your form. Now, you can use SetNodeValue like this:

    setNodeValue(XDocument.DOM.selectSingleNode("/my:myFields/my:field1"),'text');

    Have fun!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.