I have a Combo Box. I’d like to add validation to it to make sure you select an option.
Validation is not a category under Properties like it is with some other types of fields.
I went into All Properties. I set required to true. This didn’t seem to have any effect.
I went into All Properties again. In Validators I added a validateRequired, and set the message. Nothing seemed to change.
I added a Display Errors control and set it to display errors for the Combo Box. Still nothing happens. I can save no problem without selecting a value.
What am I doing wrong? Any suggestions?
It was very easy to set up validation for an Edit Box date field, and to make sure it wasn’t set to a date in the future.
Could this be related to PHAN7PRL37? Was this fixed?
http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllThreadedWeb/e6009cbf8ac90cb785257598003a0519?OpenDocument
Subject: Re: ComboBox validation
PHAN7PRL37 bug was fixed in 8.5.1. That particular issue was that you could set the control as required and the validation triggered, but whatever the message you entered, it was ignored. The message returned to the user was just something like “Field Required”.
The requiredValidator will work, but bear in mind that the comboBox selects by default the first option in the list (same as for classic web development). So if you add an option with a null value as the first item in the list. Bear in mind that the requireValidator triggers client-side validation only though.
If you need server-side validation, try adding client-side javascript to the onChange event to push the same value to an Edit Box (linked to a viewScope variable, to avoid saving the value?), and make that control required.