1 Reply Latest reply on Aug 4, 2009 5:34 PM by Nick Belaevski

    Only allow positive decimal values in h:inputText

    Alex Cougarman Apprentice

      Is there a validator or converter that will prevent negative values from being sent to the server? Here's what the inputText looks like:

      <h:inputText value="#{oc.overtimeHours}" id="#{oc.overtimeHoursId}"
       converterMessage="OT Hours for Date must be numeric and in this format: 99.9"
       requiredMessage="OT Hours is required if Date has a value." maxlength="4" style="width:50px;"
       required="#{oc.overtimeDate == null || oc.overtimeDate.toString() == '' ? false : true}" >
       <f:convertNumber maxFractionDigits="1" maxIntegerDigits="2" type="number" />
      </h:inputText>