Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

When inputfied is changed then hide a button?

Hi,

I've a field A as input field. Now when i change a any value of the field in the tablebox then i want to hide one button.

1 Solution

Accepted Solutions
tanelry
Partner - Creator II
Partner - Creator II

I usually create calculated variable vInputChanged: = sum(all if( not A_inputfield = A_shadowfield, 1, 0))

It will show number of changed inputfield values. With no changes the value is 0. Keyword "all" disregards any selections.

Then use this variable in the object's show condition as needed.

View solution in original post

5 Replies
klausskalts
Partner - Creator
Partner - Creator

First create (in the script) a Shadow-field with the original value of the Inputfield

Then make a condition in  Conditional Show in the Layout Tab of the properties:

Value of Shadow-field = Value of Inputfield

Toggle between show all Tabs and Objects by using the <Ctrl>+<Shift>+<S> shortcut.

OK?

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Ya i created shadow field and tried as you said previously but the think is if you select only one data value it will work.

For Eg:

ID   SName LName

1      A             Z

2      B            Y

- Assume that the above structure is displayed in tablebox and the input fields are SName, LName.

- Now i'll change A to AAA it will not hide the button. But if you contain table box like below it will work.

ID   SName LName

1      A             Z

tanelry
Partner - Creator II
Partner - Creator II

I usually create calculated variable vInputChanged: = sum(all if( not A_inputfield = A_shadowfield, 1, 0))

It will show number of changed inputfield values. With no changes the value is 0. Keyword "all" disregards any selections.

Then use this variable in the object's show condition as needed.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Thanks Tanel it's working. But, when i want to see the button i need to give A_inputfield value as per data what we have previously. The think is i will change the value and then i perform another selections and i leave the file. When again i open the file i not able to see the button b'coz the inputfield value is changed. Is there any process to control this.

tanelry
Partner - Creator II
Partner - Creator II

I'm not sure if that is what you ask for, but to delete user input you use macro:

sub ResetInput

set fld1 = ActiveDocument.Fields("A_inputfield")

fld1.ResetInputFieldValues 0
'Reset mode (integer) 0 = Reset all values, 1 = Reset possible values, 2 = reset single value

end sub

Note that in most situations it is good to set this macro triggered by OnPostReload too (if you change inputfield values during reload).