Set element/attribute to a variable in jscript? - InfoPath Dev
in

InfoPath Dev

Set element/attribute to a variable in jscript?

Last post 07-30-2007 01:55 PM by admot. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-30-2007 12:12 PM

    • admot
    • Top 500 Contributor
      Male
    • Joined on 08-09-2006
    • USA
    • Posts 51

    Set element/attribute to a variable in jscript?

    I feel this is REALLY a newbie question:

    How do I set an element or attribute to a variable in jscript? The code below is what I tried. The first line sets a variable to a function. I then use this function in an alert to verify it's presence. The last line is the issue. The syntax doesn't seem to work. I did several searches before posting but I couldn't not find anything.

     

     var GUIDLabel = GUIDGen();

    XDocument.UI.Alert (GUIDLabel);

    XDocument.DOM.selectSingleNode("my:Main/my:Subgroup/my:Microgroup/my:GUIDForm").Text = GUIDLabel;

    Don't grow old regretting the things you didn't do.
  • 07-30-2007 01:55 PM In reply to

    • admot
    • Top 500 Contributor
      Male
    • Joined on 08-09-2006
    • USA
    • Posts 51

    Re: Set element/attribute to a variable in jscript?

    I believe I found the answer. Needed to set the value as a string.

     XDocument.DOM.selectSingleNode("my:Main/my:Subgroup/my:Microgroup/my:GUIDForm").Text = String(GUIDLabel);

    Don't grow old regretting the things you didn't do.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.