How do I include an Optional Section by the contents of a drop-down list box? - InfoPath Dev
in

InfoPath Dev

How do I include an Optional Section by the contents of a drop-down list box?

Last post 02-09-2011 02:26 PM by Patrick Halstead. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 02-07-2011 05:47 AM

    How do I include an Optional Section by the contents of a drop-down list box?

    I'm working with IP2003. I have an Optional Section that is set for "do not include section in the form by default" and that works for 19 out of 20 of my choices in a drop-down Listbox. In the odd instance this section must be displayed and I would like to have it "Include the section in the form by default" when that choice is made in the drop-down Listbox. If the answer includes writing code I have no experience with that and would ask that you direct me to where this code could be found or to some one willing to help me to write it. Thank you in advance for your assistance.
  • 02-07-2011 10:49 AM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    It does require you to write code to insert a node/group when a selection is made (and then delete it again when the seletion changes).

    You might also look into the Qdabra.com qRules product which has an Insert command that can do this too. This doesn't require code.

  • 02-07-2011 12:07 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Hi exemplaris,

    Instead of writing code and using optional sections, you could just use a normal section with conditional formatting to hide the section when your drop-down listbox is not the odd choice.

    Would this work for you?

  • 02-07-2011 09:11 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Thanks for the response. The price tag for the qRules is a bit much for the one thing I need. So is there anyone that can help me with this code?
  • 02-07-2011 09:15 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Unfortunately a "regular" section won't work. In the 19 cases the info in the section is an option to those 19 cases. In the odd case the info is primary. Thank you for your response anyway.
  • 02-07-2011 10:17 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Hi Exemplaris,

    Qwerty is right - you don't need qRules. Just wrap your controls in a section that has a formatting rule that hides the section if the one value is not selected. You can add default data to the form so that the section always has fields in it. Of course, you can't require that they be entered since that would cause a validation error. But, so long as the fields aren't required, having them blank should not be a big problem.

    qRules price tag? Is today Monday or what? This forum is free dude. We pretty much give qRules away. We certainly don't make any money off of this forum and qRules is so far from being profitable that it's currently yet another gift to the community. We charge for it because most people end up needing an hour or two of support and if we gave that away for free too we would go out of business. OK, so you have no money. Fine. You can have qRules for free and the cost of a 4-5 sentence testimonial describing how it solved world hunger, provided peace and eternal salvation to InfoPath users everywhere. Fair enough? :)

    Patrick Halstead
    Project Manager at Qdabra
  • 02-09-2011 08:57 AM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    First, thank you for the response. As I mentioned before a regular section won't work, let me try to clear this up. The drop-down list box contains the names of 20 pieces of equipment. Each of these pieces has information that I want to gather during installation; serial number, supply voltage etc. I have placed the controls for this information in a regular Section. One of the pieces of equipment can be a stand alone OR an add-on option to the other pieces of equipment. For this item I have inserted an Optional Section further down in the report where other optional equipment reside. Inside this Optional Section are the same types of controls as in the regular section; serial number, supply voltage etc. If any of the "19" pieces of equipment are chosen the 20th is available via the Optional Section. If the 20th is chosen I hide the regular section and want to have the Optional Section "Included in the form" or opened. This way the information for this piece of equipment is always stored in the same fields. And as to your rant, I would have thought as someone who is associated with Qdabra that you would not use this forum in this way. Maybe you don't have to deal with management to get funds for this type of product but it is difficult to convince them that $199.00 to $1950.00 is money well spent to solve one minor, not truly necessary issue. If you read my original question I ask for help with the code if that is what it took. Although I appreciate Greg's response it came across like "Yep, it'll take code! Here buy this!" I don't have problem with people making money just don't try to disguise it as "free". If no one from Qdabra wants to help with this code without trying to make a buck fine, but be up front about it! My plea went out to all who use this forum. If I don't get a usable solution I'll work around it. Don't get me wrong I appreciate that this forum exists and is free, as I imagine most if not all users do, but coming from a "professional" I find your comments uncalled for and unprofessional.
  • 02-09-2011 12:24 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Hi exemplaris, you can still use a regular section to do this, I think. Add a button to insert or hide the section. You would have to add a field to your data source, "hideSection", set to true(). If hideSection = true() and equipment != "option20" then Hide this control. The button sets hideSection to the opposite of its current value.

    Qwerty
  • 02-09-2011 01:25 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Qwerty, thanks for the response. I think you are correct that that would work. I had previously used a Option Button with two buttons 'Show Option 20 Details' and 'Hide Option 20 Details'. These were in separate sections that would hide the selected button and show the unselected button, thereby always providing only the opposite state. Then if Option 20 was selected in the equipment a rule would set the "Show Option 20 Details" button. I wanted to change to using an Optional Section so that the Option 20 Details would be more visually homogeneous with the other options that are also available via Option Sections in this part of the form. Again I appreciate your input. As it stands now everything else works it's just that when Option 20 is selected in the equipment list the user still has to click on the Optional Section to have its contents displayed. Not terrible but also not how I would like it. BTW how do you get space between the paragraphs in this forum? I have them when I type and if I go back and edit but they don't show when I post.
  • 02-09-2011 02:26 PM In reply to

    Re: How do I include an Optional Section by the contents of a drop-down list box?

    Hi Exemplaris,

    Sorry for my rant. We'll try to tone it down here. We are committed to helping the InfoPath community and we appreciate those who support us in doing so.

    Yours truly,

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.