Two Jscript Problems: Can't Find Solution - InfoPath Dev
in

InfoPath Dev

Two Jscript Problems: Can't Find Solution

Last post 03-10-2005 05:32 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-10-2005 06:16 AM

    Two Jscript Problems: Can't Find Solution

    I'm an InfoPath newbie hoping the following syntax problems might be easy for some of you to fix. I've searched in Help, online resources, and even purchased "Beginning InfoPath 2003" and still can't find a solution.

    Created a jscript function to manipulate date fields (to call from an OnAfterChange event). Very simple at this point. Problems:

    1. This statement doesn't seem to correctly reference the weekDay field:
    var weekDay1 = XDocument.DOM.selectSingleNode("//my:day1/my:weekDay");
    The cell bound to weekDay1 remains blank even with something simple like weekDay1 = "test". The field is inside a Group called "day1" that seems to be properly bound to the cell. If I try weekDay1.text = "test" I get a "null or not an object error". Is the problem here: ("//my:day1/my:weekDay") ?


    2. I get a "type mismatch" error when I try to set one field to the value of another--even though I tried setting both to date or both to text:
    var weekStart = XDocument.DOM.selectSingleNode("//my:weekStartDate");
    var date3 = XDocument.DOM.selectSingleNode("//my:date3");
    date3.text = weekStart

    Any help will be appreciated.

    mg
  • 03-10-2005 05:32 PM In reply to

    Re: Two Jscript Problems: Can't Find Solution

    Hi MG!
    Welcome to the board. For examples of how to use dates with jscript open up any one of the 25 Samples that ship with InfoPath in the designer and extract the form files. Look at the script.js files. Should have lots of good info in there for you.
    Patrick
    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.