1 Reply Latest reply on Nov 8, 2010 11:14 AM by herberson

    Fields required in a form

    daniele4
      Hi, i have a form with some mandatory input fields.  I used the attribute required=true to make a input field required.
      I have two field (phone number and email) and almost one of them must be required; so i cant add the attribute required = true to both of them.    How can i manage it?
      thanks


        • 1. Re: Fields required in a form
          herberson

          This may seem odd but this validation must coded by you.

          For you had the same behavior from use of required attribute you have to define the id attribute for all form fields and on de method with validation code you have to use:



          FacesMessages.instance().addToControl(htmlId, messageKey);



          Herberson