3

I have 7 text fields in my Adobe form and if one of them is hidden, the next fields should move up.

Currently, the text field between "Retenue..." and "Jalons" is hidden correctly but the fields below did not move up.

When one field is hidden, how to move up its below fields?

enter image description here

Here is the javascript code for the text field, to hide it:

if (xfa.layout.page(this) != xfa.layout.pageCount()){
    this.presence ="hidden";
}
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Youssra Saoudi
  • 105
  • 3
  • 13

1 Answers1

0

Your JS seems correct since the field disappears.
Therefore the problem is most likely that you haven't configured the parent form correctly.
Here's a working example: enter image description here

  1. Create a subform
  2. Set it to "Textflow" (I don't know the actual english word, I'm using it in German)
  3. Move the textfields directly into that subform

That should be all, now when you change one of the textfields' presence to "hidden" the others will move up.

Cold_Class
  • 3,214
  • 4
  • 39
  • 82
  • i have already a flowed subform and the most weird thing is that the presence in the docready event works in the pdf preview but when i use it directly in the transaction me23n it doens't work can u explain it to me – Youssra Saoudi Jul 15 '19 at 09:03
  • No, I can not unfortunately, I don't know that TA - seems the docready event is not triggered then. Maybe try some other events then, like 'initialize'. Since it works in preview you should edit your question accordingly so everyone knows that the error only occurs in a specific SAP TA. – Cold_Class Jul 16 '19 at 10:07
  • if your subform and the page/subform in which the fields are embedded is set to flowed, you can try putting all the fields in a table control and then change the JS code to show/hide for the individual table row. – Anuj Kaithwas Aug 19 '21 at 10:52