Expand my Community achievements bar.

Image Display based on Drop Down?

Avatar

Level 2

Hello!

Very new to forms here. Received some excellent help yesterday on some questions I had, so hoping you can help me today.

I own a mechanic repair shop, and we are converting a lot of our service sheets for trucks to pdf forms to be filled out by our mechanics. Some companies we service have their own service sheet templates, while others use our "standard" service sheet.

I am trying to convert our standard service sheet to pdf form for our mechanics to fill out on the computer (rather than pen & paper), and would like to add a customized element to make our customers feel special. I have a drop down box on the form that has a list of our customers. When the mechanic selects the customer, I would like the customers logo to be automatically loaded in the top right corner of the form. By default the logo in the corner will be our own. For instance, if mechanic is doing a service for customer "x", and he selects customer x from the drop down box, then I would like customer x's logo to display in the top right corner of the form. I have all of our customers logos on file.

Keep in mind I am not very good at programming, so be gentle on me!!

Thanks for your help!

5 Replies

Avatar

Level 10

Hi,

there are several ways doing this.

The simpliest is to add an image object for each individual logo (logo1, logo2 etc.) into the form and change the visiblity depending on the drop down box delection.

Drop down change:Event:

Avatar

Level 2

Radzmar,

I have attempted implementing the code you suggested, with all image files

renamed properly to match the code. However, nothing happens? I have

attached the form I am working on. I just threw the pictures randomly on

the form to test the functionality. Any chance you could comment where I

have gone wrong?

Thanks!

Avatar

Level 2

Sorry, it didnt attach.

Here is the code is used:


form1.#subform[0].DropDownList1::change - (JavaScript, client)


if

(xfa.event.newText === "Swan Moving and Storage")

{

logo1.presence

= "visible";

logo2.presence

= "hidden";

logo3.presence

= "hidden";

 


}


else

if
(xfa.event.newText
=== "Barzotti
Woodworking")

 


{


logo1.presence

= "hidden";

logo2.presence

= "visible";

logo3.presence

= "hidden";

}


else


 


{


logo1.presence

= "hidden";

logo2.presence

= "hidden";

logo3.presence

= "visible";

 

}


I have renamed the logos to be logo1, logo2, and logo3 respectively.

Not sure where I am going wrong?

Thanks!

Avatar

Level 10

Is your form saved as dynamic form?

And, where are the logos located in the forms hierarchie?

Are they also placed under form1.#subform[0]. or elsewhere?

Avatar

Level 2

Radzmar,

Could I email you a copy of the form so you can have a look where I am going

wrong? My email is royalss@bellnet.ca, you can send me an email and I will

respond back with the form. Would really appreciate it.

Thanks.