Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
Empty entry from dropdown selected, the required value validator didn't fired error
posted

Hi

 In the dataSource List I am adding an empty entry on top of the dropdown when user doesn't select a different value and required is set to true for the dropdown on submission a validation error is not fired for drop down.

 

Here is how I am adding the empty entry:

aList.add(new SelectItem("", null));

 After this rest of the values gets added. When the drop down is displayed it is selecting the first entry by default which is the expected behaviour. But if user doesn't selects something different and required="true" in the dropdown tag I will expect a validation error thrown for the user.

Thanks

S Fozia