Expand my Community achievements bar.

More help with visible and hidden fields

Avatar

Level 2

Looking for the script that will let me click a button and then show hidden text fields.

Here's what I want to do:

I have a text field on my form that if another text field is needed, the user clicks the "Add another Case" button and the hidden text field will appear.

8 Replies

Avatar

Level 10

In the click event of the button write the following script to display the hidden text field..

TextField1.presence = "visible";

This script will work with both JavaScript and FormCalc.

Here is how to get the script editor if you are not familiar with..

https://acrobat.com/#d=rsCC1f9e-ZIRp1Nf8RJWEQ

Thanks

Srini

Avatar

Level 2

Is there someting else needed? That one line isn't showing the hidden text field.

Thanks for your help.

Avatar

Level 4

Hi there

It might be better to create a dynamic form and wrap your text field in a subform.  When you click the button the form expands and the subform is repeated.  This is more useful if you do not know the number of entries a user might need.  If you need any help with this then let mem know

Avatar

Level 2

Yes, unfortunately I need help.  I'm a new user and can use all the help I can get.

Thanks.

Avatar

Level 4

Okay happy to look through form but no expert!  Can you add the form and detail of what you want to do here?

Avatar

Level 2

Sure.

Basically, I have several needs on this form:

First,  I only want a text field to be visible if the Add New button is selected.  Otherwise I need the text field hidden.

Secondly, I have several text fields where I need to allow for multiple entries of the same type of information.  Such as Party Information (which consists of name, address, city, state, etc.)  There will be more than one party, so I would need the form to record the first information for the party, then the user clicks Add Another Party......which then clears the previous information allowing for the user to enter the next party info, and so on.

I'm sure this is all basic stuff, but as I said, I'm new to this and just need to be set in the right direction.  Not sure how to get you the form.

Thanks a bunch.

Avatar

Level 2

Does anyone have any suggestions?  Thanks.

___________________________________________

Basically, I have several needs on this form:

First,  I only want a text field to be visible if the Add New button is selected.  Otherwise I need the text field hidden.

Secondly, I have several text fields where I need to allow for multiple entries of the same type of information.  Such as Party Information (which consists of name, address, city, state, etc.)  There will be more than one party, so I would need the form to record the first information for the party, then the user clicks Add Another Party......which then clears the previous information allowing for the user to enter the next party info, and so on.

I'm sure this is all basic stuff, but as I said, I'm new to this and just need to be set in the right direction.  Not sure how to get you the form.

Thanks a bunch

Avatar

Level 4

Hi

In the click event of the button add some javascript like

Page1.TextField1.presence = "visible";

Make sure the object's intial presence is set to hidden or invisible.

Re the party multiple entry you cannot clear the previous information as you will lose your data.  What you have to do is repeat the objects again when the user clicks a button.  Information on how to do this is widely available.  Just google 'livecycle designer scipting basics' and read the PDF.  Chapter 13 contains the info you need.

If you want to have a first go I can then have a look if you wish.  It maybe easier if you dont make a party's details to disappear when a new one is added rather just repeat it afterwards.

Thanks