Retrieve TextBox value in Repeating section - InfoPath Dev
in

InfoPath Dev

Retrieve TextBox value in Repeating section

Last post 03-29-2005 03:49 PM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-28-2005 02:47 AM

    • amish
    • Not Ranked
    • Joined on 12-24-2004
    • India
    • Posts 19

    Retrieve TextBox value in Repeating section

    Here is the problem.

    Include a Repeating Section control in my form, containing a Button and a Text Box. At runtime, user inserts more than 1 items. How do we know which Button was clicked so we can get to the Text Box#%92s value?

    For this i tried on button click:

    function CTRL1_5::OnClick(eventObj)
    {
    // Write your code here
    XDocument.UI.Alert( eventObj.Source.xml );
    }
    And this worked fine.


    But on the same lines the below code does NOT work :

    function CTRL1_5::OnClick(eventObj)
    {
    // Write your code here
    XDocument.UI.Alert(eventObj.Source.selectSingleNode("my:field1").text );

    }
    ------------------------------------------------------------
    Can you please tell me where am i going wrong?




    Amish
  • 03-29-2005 03:49 PM In reply to

    Re: Retrieve TextBox value in Repeating section

    The context for the button is the row of the table... meaning, if you have a data source that looks like this:

    Group1
    Group2
    field1

    And a repeating table that looks like this

    [button][text box]
    [button][text box]
    [button][text box]

    Clicking on the button will put our starting point for selection in Group2.

    It sounds like you already had that part figured out, but I added it for the sake of others reading this thread.

    As for why the second statement doesn't work, I'm not sure. I wrote the same code, and it worked for me:

    function CTRL3_5::OnClick(eventObj)
    {
    XDocument.UI.Alert(eventObj.Source.selectSingleNode("my:field1").text);
    }


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