locked
Html Client - Textbox background color RRS feed

  • Question

  • Hello to all good people out there. :)

    Can somebody tell me how can I change backcolor of textbox? I tried two ways:
    First, in postRender function I put $(element).css("background-color", "blue"); and then the source looks like this

    Then, I try to add this in postRender $(element).find("input").css("background-color", "blue"); and then the style is applied in input element

    <input class="id-element msls-read-only ui-input-text ui-body-a" id="e585841e2-Ukupno" style="background-color: blue;" type="text" readonly="readonly" data-mini="true">

    But, how can I add this style in the middle div
    <div class="ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow ui-body-a ui-mini"> ???

    Thank you all.

    Tuesday, November 25, 2014 8:54 AM

Answers

  • Hi,

    Postrender the textbox like:

       $(element).children().css({'background': 'blue' });
    

    Good luck!


    Sven Elm

    • Proposed as answer by Sven Elm Tuesday, December 2, 2014 1:22 PM
    • Marked as answer by Angie Xu Friday, December 5, 2014 2:43 AM
    Tuesday, December 2, 2014 1:18 PM
  • or remove the children() and add parent() instead to move it around up in the divs.

    You can use .parent().parent() or children().children().children() and so on.

    You get the point.....


    Sven Elm

    • Marked as answer by Angie Xu Friday, December 5, 2014 2:43 AM
    Tuesday, December 2, 2014 1:22 PM

All replies