Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Looking for an IF statement

Avatar

18-08-2008

Hello All,



I'm not very good with javascript at all and I have to thank everyone on the forums that have been helping me with my needs. yet here is another one.,,,,,I'm looking for a statement that will make a field appear after a button is pressed. Any ideas? i've been on this one for a week.



Thanks for all your help in advance

Replies

Avatar

Avatar
Validate 1
Level 4
Ryan_Lunka
Level 4

Likes

11 likes

Total Posts

143 posts

Correct Reply

11 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
Ryan_Lunka
Level 4

Likes

11 likes

Total Posts

143 posts

Correct Reply

11 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Ryan_Lunka
Level 4

18-08-2008

Set the field's presence to invisible or hidden (invisible will keep the layout, hidden will move things if your subform is flowable) to start.<br /><br />Then in the click event of the button use...<br /><br /><fieldname>.presence = "visible";<br /><br />If you need to programatically make the field invisible again somewhere else, you can use the same statement. Presence can be visible, invisible, or hidden.<br /><br />Hope this helps!

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

18-08-2008

Fieldname.presence = "visible" on the click event of the button.



Note that the form must be sved as dynamic for this to work.

Avatar

18-08-2008

Thanks for your help, its appreciated so much, I'm going to work on that right now. What do you mean by save as dynamic?



Thansk again 🙂

Avatar

18-08-2008

OK I have been trying for a little bit now and still not getting this to work for me. I put this in and its not taking. Any Suggestions? I know somethings wrong in there, just can't find it.<br /><br />if <button3>.event activity="click" then<br /><Imagefield1>.presence="visible"<br />else <br /><Imagefield1>.presence="hidden"<br />endif<br /><br />Thanks again Lucy<br /><br />P.S. I figured out the dynamic thing but still havn't a clue what the difference is.

Avatar

18-08-2008

Hi,

Select the button and go to the script viewer. Choose the click event from the dropdown box. Remember to choose javascript. Let's say the field name is ImageField1. Add the following code:



ImageField1.presence = "visible"



Also, you have to set the Image field to hidden or invisible as standard for this to work.



By the way, scripts make a pdf dynamic, so you need to save as dynamic pdf to make the script run.

Avatar

19-08-2008

Thanks I added that to the ImageField1. But I still need it to trigger something. Maybe I am confusing everyone becasue i have not many clues ova here can't say no clue. LOL.



I have a button (plain button no action)I want it to do the following when clicked:



1. populate a picture (has to populate first)

2. Send an E-mail out with the form attached showing signature.



I thaught about changing it up: a Radio button Yes or no but I need the same action to take place.



What you gave me above is only part of what I need (I think)



Any more suggestions,.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

19-08-2008

To be able to dynamically populate a picture is against the security in Acrobat (you canot do something that the user does not know you are goinng to do). You can have them choose a picture to put in the image field (by having them select the image they are making the choice themselves). Is this a viable solution?



Conversely if the form is loaded and the picture is already in the form, that is OK. You can make the picture visible/invisible as required.



Can you tell us which way you want to solve this and then I can suggest an approach.

Avatar

19-08-2008

I can't have them load the picture themselves.



Can I have the picture invisible on the form until the button is clicked. at the click of the button 2 things happen. 1. The picture becomes visible 2. The form is sent as a pdf to an e-mail address.



I can switch it to a radio button also but when yes is selected I need the picture to become visible.



Any ideas? or can I even do it.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

20-08-2008

Yes you can make it visible if it is already there. You will have to make your form dynamic and set the image as invisible to start. Then on the event that you want to trigger the change use this code:



imagename.presence = "visible";