Dan Hoeck
Posts: 0
Joined: Sat May 17, 2014 3:55 am

How can I have a label change font colors depending on the word displayed?

The label changes color depending on whether a static label, with text "" is displayed or not. The label is inside a radio group. The radio group elements are mapped from a query. If the query returns no results, label is not equal to "", and the color of a different label is supposed to change colors.

While the code properly populates the value of the static label (mobilelabel_169), it isn't recognizing when the static label is equal to "".

This is what I have so far:

var title1 = Appery('mobilelabel_169').text();

if (title1 == "") {
Appery("title_confirmed").css('color','#333333');

} else {
Appery("title_confirmed").css('color','#DCDCDC');

Code: Select all

 return; 

}

Thank you!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How can I have a label change font colors depending on the word displayed?

Dan,

Try code with other colors:

pre

var title1 = Appery('mobilelabel').text();

if (title1 == "") {
Appery("title_confirmed").css('color','#f00');

} else {
Appery("title_confirmed").css('color','#0f0');

}
/pre

You don't see changes as your color is almost the same as default.

Dan Hoeck
Posts: 0
Joined: Sat May 17, 2014 3:55 am

How can I have a label change font colors depending on the word displayed?

this was correct!

I found other issues that prevented this from working within my mapping.

Thank you for your help!

Return to “Issues”