How do i add dynamic text button in InfoPath 2007 Form Template. - InfoPath Dev
in

InfoPath Dev

How do i add dynamic text button in InfoPath 2007 Form Template.

Last post 03-28-2008 04:41 PM by Greg Collins. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-26-2008 11:02 PM

    How do i add dynamic text button in InfoPath 2007 Form Template.

    I am working on VS2008 and trying to create a InfoPath 2007 Form Template (C# as the language).

    In which i will add a button on the designer and on click of that button i need to create a text box (ie at runtime dynamically)to get some text from the user.

     the full scenario is as such:

    Hi,
    the scenario is as such:
    on the click of a button i show some 3 text box and a button to the user.
    in the first text box he adds a title
    in the seconf text box he adds the description of it.
    in the third text box he adds the lessons adn if he needs to add more lesson's in a particular title he needs to click on the button and one more text box will be shown to the user where he would add more lesson and then finally a save button to save all this details via a web service to a DB.

    Thanks ,

    Pramod Mehta

    Filed under: , , ,
  • 03-27-2008 04:10 PM In reply to

    Re: How do i add dynamic text button in InfoPath 2007 Form Template.

    You will need to place your text boxes in a section. The section has conditional formatting to hide if some field value is not set to true, for example. The button, when clicked, has a rule that sets that field value to true, causing the section to be displayed.

  • 03-27-2008 09:50 PM In reply to

    Re: How do i add dynamic text button in InfoPath 2007 Form Template.

    Hi Greg Collins ,

    the method you suggested would have all thetextboxes to be placed at the desgintime itself... but i need to generate a textbox only if the user clicks on the button and not in the design time.

     

    Thanks.


  • 03-28-2008 04:39 PM In reply to

    Re: How do i add dynamic text button in InfoPath 2007 Form Template.

    Then what you are needing to do is to make sure that your form schema is set up to have those fields... and then you will need to write code behind your button to add in the XML DOM nodes for those fields.

  • 03-28-2008 04:41 PM In reply to

    Re: How do i add dynamic text button in InfoPath 2007 Form Template.

    I should add that unless you have the fields in your schema, you are not going to be able to add them at runtime. The only way to do this is to have the fields in your schema, but not the nodes in your XML... and then add the nodes to your XML at runtime. You need them in your schema or you cannot build them into your form template at design time -- which is the only way it can be done.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.