Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Questions related to using nuBuilder Forte.
-
Timo
- Posts: 217
- Joined: Thu Mar 15, 2018 9:26 pm
- Has thanked: 1 time
Unread post
by Timo »
My requirement is to load a different image to an Object of Type Image when a form is opened.
I thought I could to this by JavaScript and tried
Code: Select all
nuAttachImage('logo', 'imgProject1');
but the image is not changed.
Code: Select all
if (nuFormType() == 'edit') {
switch (project) {
case 'project1':
img = "imgProject1";
break;
case 'project2':
img = "imgProject2";
break;
case 'project3':
img = "imgProject3";
break;
}
nuAttachImage('logo', img); ----> not working!
}
-
admin
- Site Admin
- Posts: 2814
- Joined: Mon Jun 15, 2009 2:23 am
- Been thanked: 25 times
Unread post
by admin »
Timo,
Do you have a div with an id of logo?
Steven
-
Timo
- Posts: 217
- Joined: Thu Mar 15, 2018 9:26 pm
- Has thanked: 1 time
Unread post
by Timo »
No, I use the Tab - Image of an Object of Type Image
The Image Object is an easy way to display a specific image stored in nuBuilder Files.
-
toms
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms »
Hi,
Change the Type of your object to HTML and nuAttachImage() will work.
-
Timo
- Posts: 217
- Joined: Thu Mar 15, 2018 9:26 pm
- Has thanked: 1 time
Unread post
by Timo »
thank you, works