How to Show/Hide an Optional Section Programmatically - InfoPath Dev
in

InfoPath Dev

How to Show/Hide an Optional Section Programmatically

Last post 03-22-2010 10:47 PM by Qazi Anis. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-17-2010 05:21 PM

    How to Show/Hide an Optional Section Programmatically

    In my browser-enabled form (InfoPath 2007), I have an Optional Section control I want to show/hide selectively using code-behind.  In a client-only form, I understand this can be accomplished by calling the ExecuteAction method on the control.  Is there an equivalent for browser-enabled forms?  Thanks.

    Filed under:
  • 03-22-2010 02:02 AM In reply to

    Re: How to Show/Hide an Optional Section Programmatically

    ExecuteAction is not supported in browser-enabled forms. A work around for your problem may be

    1) have an additional field(say is_opt_sec_visible) in your form.

    2) place conditional formating on optional section if is_opt_sec_visible = "1". hide the field.

    3) In the code decide whether the optional section needs to be shown or not. if yes set the value of is_opt_sec_visible to 0, otherwise set is_opt_sec_visible to 1.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 03-22-2010 01:25 PM In reply to

    Re: How to Show/Hide an Optional Section Programmatically

     I was able to do what I needed without code.  However, for those who must use code, what you suggest seems like a good workaround to the problem.  Thank you.

  • 03-22-2010 10:47 PM In reply to

    Re: How to Show/Hide an Optional Section Programmatically

    you had mentioned programmatically that is why is used the code

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.