Skip to main content
Participant
July 6, 2023
Question

DropDown list not refreshing presence of the fields

  • July 6, 2023
  • 1 reply
  • 587 views

Live cycle Designer/ PDF interactive form/ javascript/dropdown list/

Hi all,

I have problem with changing the visibility/presence of fields and text on the form after selecting the options from drop down list for the second time.
My case is as follows:

I have one dropdown list with 3 possible values, each of them makes other fields visible or hidden. For each first choice after opening the pdf, everything works fine, the problem is when I would like to select a different value from the dropdown list, e.g. from 1 to the second option, then all fields in the subform are reset and nothing happensand the dropdown list is empty. For the second time when I select a value in the dropdown, the visible fields are activated, those that were supposed to be visible.

 Im using JavaScript, and the code is placed in change event of the dropdown list. Many fields are from different subform, than Im using code:  subform3.field10.presence, for the fields form the same subform as the dropdown list Im using parent.field1.presence.

sample code that I'm using:

if(this.rawValue=="1"){
this.parent.field1.presence = "hidden";
this.parent.field2..presence = "hidden"; }

if(this.rawValue=="2"){
this.parent.field1.presence = "visible";
this.parent.field2..presence = "visible"; }

 

I also tried the code that uses xfa.event.newText on the change and mouseexit event, but it didnt help. 

Does anyone have any suggestions what could be here the case?

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
July 6, 2023
Participant
July 11, 2023

Hi, already asked, but no one answered 😞