:: Forum >>

Input box setStyle not working properly

Hi, I'm using AW 2.5.2 and the following two lines of code do not function properly:

inpJobSearch.setStyle ( 'background', found == false ? '#ff6666' : 'white' );

In this code, inpJobSearch is an instance of AW.UI.Input. The color that gets set when found == false is #ff2234, not #ff6666. I have no clue where this color comes from, as it does not appear anywhere else in my application.

inpJobSearch.setStyle ( 'color', found == false ? 'white' : 'black' );

This line just flat out does not do what I would think it should do (change the text color for the input box text). Is there some other way of accomplishing this?

Thanks!
Derrick
Thursday, August 21, 2008
Oh, and I've tried using '!important' with both lines of code and that does not work. Also, this affects both FF3 and IE7 for me.
Derrick
Thursday, August 21, 2008
var objInp = new AW.UI.Input;
objInp.setControlText('My Input');

objInp.getContent('box/text').setStyle ( 'color', function() {return found == false ? 'Red' : 'yellow'});

objInp.getContent('box/text').setStyle ( 'background', function() {return found == false ? 'white' : 'black'});

var found = false;

var Button = new AW.UI.Button;
Button.onControlClicked = function(){
var aFound = found;
found = !aFound;
objInp.getContent('box/text').refresh();
}

document.write(Button );
document.write(objInp);
Thursday, August 21, 2008
Thanks, that fixed the second issue. It didn't fix the first one for me, though. The background color that gets set is still a different color than I specify. Could this be a system or browser issue maybe? I've certainly never heard of it before.
Derrick
Friday, August 22, 2008
Hi Derrick,

The code seems to work fine when I tried it in IE7 and FF3.
The exact code I used is:

inpJobSearch = new AW.UI.Input;
found = false;
inpJobSearch.setStyle ( 'background', found == false ? '#ff6666' : 'white' );
document.write(inpJobSearch);


I'm not sure why its not working in your case.
Could you try the above code and see if that still produces the incorrect background color ?

Ankur
Ankur Motreja
Sunday, August 24, 2008

This topic is archived.


Back to support forum

Forum search