1 Reply Latest reply on Oct 22, 2009 5:38 AM by Ilya Shaikovsky

    ajax validation and changing background color

    gamba Newbie

      Hi,

      is it possible to change the background color of an input field,
      if there are any validation errors.

      I treid the follwoing but ist doesn't work. Style is changed only on complete
      request:

      <h:inputText id="attPersonNr" value="#{props.attributes['value'].value}"
       size="18" required="true" tabindex="2"
       style="#{classifyBean.errorOccured ? 'background-color:red;' : 'background-color:white;'}">
       <rich:ajaxValidator event="onblur" ajaxListener=" #{classifyBean.ajaxError}"/>
      </h:inputText>
      


      I think there must be an easier alternative when input-component is loosing focus.

      Thx,
      Gamba