Highlighted

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

Highlighted

Avatar

Avatar

Ryan_Lunka

Avatar

Ryan_Lunka

Ryan_Lunka

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!
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

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.
Highlighted

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 🙂
Highlighted

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.
Highlighted

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.
Highlighted

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,.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

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.
Highlighted

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.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

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";