Trouble hiding / revealing sections with conditional formatting - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Trouble hiding / revealing sections with conditional formatting

Last post 12-19-2011 04:26 PM by Miss Lola. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 12-06-2011 08:50 PM

    Trouble hiding / revealing sections with conditional formatting

    Hi, I'm building a form which requires users to fill out certain fields in order for the data to calculate accurately through the formulas I have set up.

    I made the fields required, however as my form has two views and the users looking at the first view need to be able to submit it I had to remove the required fields as at the time that View 1 needs to be submitted View 2 will always be blank and because of the required fields on view 2 it was stopping the form from being submitted.

    So I have now set up conditional formatting on my submit button so that if any of the fields I need are not filled in the button is disabled preventing the form from being submitted. This works perfectly however, I want to put a box next to the button which explains to the users why the submit button is not available to them and what they need to do in order to be able to submit the form.

    I want this box to hide if the form is filled in correctly and show when the required fields are blank - so basically whenever the button control is disabled it should appear on the screen and whenever the button is enabled it should hide.

    I have tried creating conditional formatting the same as I have done for my button to achieve this, however as soon as the first condition is met the section hides and does not re-appear again.

    The required fields are in a repeating table and in the instance of the button even if all of the required fields are filled in in the first row (enabling the button) as soon as a user inserts a new row the button is disabled again until the fields in that row are filled out properly and so on.. I just want to know why the box (section) I have created does not hide and re-appear in the same way?

    As soon as all of the fields in the first row are filled in the section hides and even when I insert a new blank row it remains hidden.

    The condition I have set up is when Field A & Field B & Field C are not blank Hide this control.

    Is there any way to make this section behave in the way I want? Can it be linked to the button?

    What am I doing wrong?

  • 12-06-2011 11:19 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Shouldn't the condition be (Field A is blank) or (Field B is blank) or (Field C is blank) - Hide this control.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-07-2011 12:38 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Hi Jimmy,

    Thanks for your reply, unfortunately the condition you suggest won't work because when the fields are blank is when the box needs to be displayed.

     

    Thanks anyway

    L

  • 12-08-2011 11:05 AM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    I'm attaching a form for what I think you are trying to get at.

    Button - if (field1 is blank OR field2 is blank OR field3 is blank) -> Hide button

    Section w/Instructions - if (Field1 is not blank AND Field2 is not blank AND Field3 is not blank) -> Hide section

    Let me know if this works for you!

  • 12-08-2011 12:27 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Hi thanks for your reply and for taking the time to create the example for me.

    I already have these formulas set up in my form and they do work, however my problem is the required fields are in a repeating table so when a new row is added the fields are essentially blank again (in the new row) so the section should re-appear and the button should be disabled again.

    The button is working perfectly - anytime a new blank row is added to the table it is disabled again until all of the fields in that new row are filled in but no matter what I do the section does not function in this same way. As soon as the fields are filled out in the first row of the table it hides (as it should) but when new blank rows are added I need it to re-appear and it doesn't.

     Any thoughts on what I might be doing wrong?

  • 12-08-2011 12:38 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    My mistake on the earlier formula.  I misunderstood your post.

    Have you tried using the All instances of... option in the Select Field or Group dialog when setting up your condition?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-08-2011 02:03 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Jimmy has it right. You have to use the All Instances... and Any Instances... since you are working with repeating data.

    I attached the updated form.

  • 12-08-2011 03:15 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Hi Guys,

    Thanks so much for the tip! I wasn't even aware that function existed! The section now hides and reveals perfectly when it should!

    Thanks so much for helping a lost little newb find her way!

     Much appreciated!

    L

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

    Re: Trouble hiding / revealing sections with conditional formatting

     

    I think I celebrated too early as I have encoutered another issue.

    I have re-set my conditions using the "All occurrences of" function and it works perfectly for my first repeating table however I have 3 repeating tables on my view (two are in optional sections) and although I have set up conditions for them they don't seem to work.

    It seems like it is running the conditions set up for the first repeating table and then just stopping.

    What I need is for the box to be revealed when someone inserts either of the two optional sections and then hide once the required fields in these sections are filled in and then if a new blank row is added to either table the box will be revealed again until all fields in the new row are filled in.

     At the moment the box hides once all fields in the first repeating table are filled in and only re-appears if a new blank row is added to it, when I insert either of the optional sections the box just remains hidden, why isn't it continuing through the steps I have set up and revealing when the new blank tables are added?

    My button works perfectly with all 3 tables so why don't the same types of conditions work on the section?

  • 12-18-2011 03:08 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Hi,

    I'm still having difficulty getting this to work for all three of my tables, it works perfectly now on the first table but not on the other two, it's like the rules are only running for the first table and then stopping.

    Any further insight that you can offer me would be greatly appreciated.

     I thank you for your time.

  • 12-18-2011 11:29 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Could you show us some screenshots of how your conditions are set up?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-19-2011 04:26 PM In reply to

    Re: Trouble hiding / revealing sections with conditional formatting

    Hi Jimmy,                                                   

    Please see attached for screen shots.

    I hope that I am making sense with what I am trying to do!

    Basically if any of the specified fields in the default table are left blank the section that I have added in the form with text in it will be displayed and if they are all filled in it will hide, then if someone inserts either of the optional sections, the section with the text should appear again until all of the fields in the new table are filled in.

     

    Thanks again for taking the time to help me with this.

     L


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