Displaying something on click? - InfoPath Dev
in

InfoPath Dev

Displaying something on click?

Last post 12-16-2008 02:40 AM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-16-2008 02:14 AM

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

    Displaying something on click?

    Do you guys know if there is a way to display a text box once the user clicks on a certain other text field?

     I.e. they click in the field "Name" and it brings up a text box

     Cheers

     

  • 12-16-2008 02:40 AM In reply to

    Re: Displaying something on click?

    Hi,

    Add a string field (field2) to the schema with the default value to 0. Add a text field to the schema and UI. Add a conditional formatting to this text field as if the field2 is not equal to 1 then hide the control. Now add the following code in the on context change event.

    InfoPathEventHandler(EventType = InfoPathEventType.OnContextChange)]

    public void FormEvents_OnContextChange(DocContextChangeEvent e)

    {

    if (e.Context.nodeName == "my:field1")

    {                    

    thisXDocument.DOM.selectSingleNode("/my:myFields/my:field2").text = "1";

    }

    if (e.Type == "ContextNode")

    {

    // The XML selection or context has changed.

    // Write your code here.

    return;

    }

    }

     

    Here field1 -> first text box

     

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.