Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

clear mandatory fields when section hidden

Avatar

Former Community Member

Hello,

I have set up a Radio button with two options. When the user chooses option 1 another radio button comes up asking another question. The user will either choose option 1 or option 2.  If the user chooses option 1 and enters the information then changes their mind and goes back and chooses option 2 the information is still showing in the fields.  I am using the following script in the exit event for both options 'xfa.host.resetData("form.content.MailingAdd").

When the user submits the form, it does not recognize the hidden fields, but the information entered into the section still shows up on the xml code when submitted.  Is there a way to entirely clear the field when it is hidden so that the information does not come through on the xml code? 

Thank you,

Nik

1 Reply

Avatar

Level 10

You can check the presence property and clear of the data before you submit..

if(Field1.presence == "hidden")

     Field1.rawValue ="";

Thanks

Srini