문제

I have two edit boxes on my xPage. Second one with typeahead enabled. I want on onFocus event make editbox background e.g. yellow... I do it this way:

var fldObj = dojo.byId("myEditBox");
if (!fldObj) {
    fldObj = dojo.query("[id$=':myEditBox']");
    if (fldObj) {
        fldObj = fldObj[0];
    }
}
if (fldObj != null) {
    fldObj.style.background="yellow";
}

it works perfect for the first edit box but not for the one with typeahead enabled.. Any suggestion?

Thanks

도움이 되었습니까?

해결책

Simple CSS does the trick. Your problem is probably caused by dojo CSS styling. Added !important overrides other inherited !important styling. Works for me with edit box with and without typeahead.

.xspInputFieldEditBox:focus, .lotusui .dijitTextBox input:focus, .xspComboBox:focus
{
  font-weight: bold;
  background-color: yellow !important;
  background: yellow !important;

} 

http://www.w3schools.com/cssref/sel_focus.asp

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top