4 Replies Latest reply on Feb 10, 2010 7:33 AM by zelenka

    h:message

    zelenka

      Hi,

       

      I have a form that contains several input boxes some of those are marked required="true". If user doesn't enter values into those input boxes I want to display error message and color h:outputLabels to red color. Is this possible?

       

      Thanks

       

      <h:form>
           <rich:panel header="Edit">
                <h:panelGrid columns="2">
                     <h:outputLabel value="Name"/>
                     <h:inputText value="#{VkladBean.vklad.nazev}" required="true"/>
                     <h:outputLabel value="Weight (g)"/>
                     <h:inputText value="#{VkladBean.vklad.vaha}" required="true"/>
                     <h:commandButton value="Save" action="#{VkladBean.ulozit}"/>
                </h:panelGrid>
                <rich:messages/>
           </rich:panel>

      </h:form>