CDD & Icons

Folks

I have a radio button that when displayed in the list it shows as an icon

Is there a way that I could make it show as an icon when displayed as a CDD? For example

Name (DB Join) >>> Town (CDD) >>> Reputation (CDD and the one to display an icon)

Thanks

Mark
 
Hi,

Can you solve your problem by making your element as an icon with CSS ? Note that it's not that easy to tweak dropdown elements...

Do you have a screenshot ? It's pretty difficult to answer your question if we can't really understand what you want.
 
Thanks Kinkaz - I can do better than that :)

If you login here using demo as username and password

http://www.lettingagentsupportklub.co.uk/j3

Then go here

http://www.lettingagentsupportklub.co.uk/j3/members-area/landlord-area/check-landlord.html

Start typing chris evans and select - you will see the CDD at the end shows Good and that is where I want the icons to display - as per this list

http://www.lettingagentsupportklub....ion=com_fabrik&view=list&listid=51&group_by=0

Thanks for any help

Mark
 
Have you tried to add some javascript to your element ? I haven't tested that for you, but using the action "load" and inserting a little script which changes the text into your image when "your element" == "Good" or "Bad" should solve your problem.

kinkaz
 
I'll leave you guys to it.

Thanks kinkaz.

I'll keep an eye on the thread in case y'all can't come up with something.

-- hugh
 
Hey,

Try this :

1. Go to your element "Full Name"
2. Add a javascript (action "change")
3. Add following code (just to test if this first step is okay, this should always set the "Good" icon to your "Reputation" element :

var check_landlord = document.getElementById('___Check_A_Landlord_Performance'); // getting your div id
var reputation = check_landlord.getElementsByTagName('div'); // getting the div where your info is set ("Good")
reputation[0].style.display = 'none'; // removing that div

var img = document.createElement("img"); // creating an image in DOM
img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/good.png"; // adding your image for "Good"
check_landlord.appendChild(img); // adding it to your element

4. If it works, you can customize like this :

var check_landlord = document.getElementById('___Check_A_Landlord_Performance');
var reputation = check_landlord.getElementsByTagName('div');
reputation[0].style.display = 'none';
var img = document.createElement("img");

if (reputation[0].innerHTML == 'Good') {

img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/good.png";

} else if (reputation[0].innerHTML == 'Bad') {

// img.src of your image

}

check_landlord.appendChild(img);
 
Hi Kinkaz

its not working?

The icon is not beign added - Its not even missing its just not changing anything - I appreciate your help on this ;)
 
If it's not a problem for you, can you PM me an access to your fabrik admin so that I can see what's wrong and try myself ?
 
  • Like
Reactions: rob
An update for you

With the very kind assistance of Kinkaz this is working fantastically. To see it in action please login here then go to this page. Type in Tony Williams and choose the town from the CDD dropdown. You should see three towns to choose from and each one has an icon to measure the reputation of the landlord :)

I can't tell you how grateful i am to Kinkaz for his very kind help and getting this to work - Thanks Kinkaz!:D

EDIT: In all the excitement I forgot to tell you the login details

demo and demo
 
Can someone help me please

I had some CDD filed filling the information in and with the help of Kinkaz icons were displayed with the help of some javascript

Can you please look at this page

http://www.lettingagentsupportklub.co.uk/j3/component/fabrik/form/78.html

If you search for an agent by name the icon displays fine (Search for my company)

If you search by town it just displays the membership by text (Search for my town)

The script in both was working fine but since I updated via github yesterday it appears to be converting the quotes etc

here is the script

Code:
var check_landlord = document.getElementById('search_agents___Agent_Membership_Level_Town');
var reputation = check_landlord.getElementsByTagName('div');
reputation[0].style.display = 'none';
 
if (check_landlord.getElementsByTagName('img')[0]) {
    var img = check_landlord.getElementsByTagName('img')[0];
} else {
    var img = document.createElement("img");
}
 
if (reputation[0].innerHTML == 'basic') {
    img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/basic.png";
} else if (reputation[0].innerHTML == 'ass') {
    img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/ass.png";
} else if (reputation[0].innerHTML == 'cert') {
    img.src = "http://www.lettingagentsupportklub.co.uk/j3/images/cert.png";
}
 
check_landlord.appendChild(img);

Can anyone identify the problem please?

Thanks
 
Thanks again to Kinkaz!

The problem was the upgraded script editor in admin which was causing a problem with the js - I have reverted back to the old editor, he has written a jquery script which is cleaner and all is well :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top