Page 1 of 1

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

Posted: Thu Aug 14, 2014 12:34 am
by Dan Hoeck

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!


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

Posted: Thu Aug 14, 2014 2:25 am
by Alena Prykhodko

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.


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

Posted: Mon Aug 18, 2014 5:47 pm
by Dan Hoeck

this was correct!

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

Thank you for your help!