Custom Submit button disabled based on Repeating Table - InfoPath Dev
in

InfoPath Dev

Custom Submit button disabled based on Repeating Table

Last post 06-20-2011 11:35 AM by tafavorite. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-16-2011 05:17 AM

    Custom Submit button disabled based on Repeating Table

    I could research this for hours or see if someone else has a solution already. What I have is a form that has a custom submit button that when clicked submits the form to a sharepoint link. The button is disabled until all required fields are filled in. When dealing with repeating tables though, it seems tricky to make this happen. I have a repeating table that has 5 columns.
    Pay Period Date        Original/Corrected          Code       Description       Original Hours                        Corrected Hours
                                   (dropdown of 2 values)                                           (required if Original slected)      (required if Corrected selected)

    There are two rows that they need to fill out on this. My biggest problem is getting the disable button to understand that it should disable if the following:

    If Original/Corrected = "Original" and Original Hours is "Blank", disable
    If Original/Corrected = "Corrected" and Corrected Hours is "Blank", disable.

    It works if the "DD" has Original selected or Corrected seleted. Once you create a new row and select the opposite selection, the disable rule is thinking that you need to enter the "HOUR" field.

    I would really appreciate some help on this. I have been stumped on this for some time now as I have another form that kind involves the same logic with a repeating table. Any help is appreciated, can attach a form if that might help more. Thanks in advance.

  • 06-19-2011 03:05 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Custom Submit button disabled based on Repeating Table

    on the conditional formatting to hide of the button you will need some conditions.

    repeating table is called my:repeatTable
    original/corrected field is called my:origOrCorr
    original hours is called my:origHours
    corrected hours is called my:corrHours

    The conditions you want are expressions with OR logic.

    count(//my:repeatTable[my:origOrCorr = 'Original' and my:origHours = '']) > 0   OR
    count(//my:repeatTable[my:origOrCorr = 'Corrected' and my:corrHours = '']) >0 

    This way, if there are any rows in the repeating table which satify your conditions then the button will be hidden.

  • 06-20-2011 11:35 AM In reply to

    Re: Custom Submit button disabled based on Repeating Table

    Thank you for your help. this was what I was looking for, just did not know how to accomplish it. Again, Thank you!

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