The situation is this: I have a select box in a form, and I want to make it required.
This is simple enough, but the blank option disappears when the required validation is applied, client-side validation is not performed, and is indeed not needed, because there are no blank values. As a corollary, the first option is always selected by default upon entry into the form.
The problem with this is that users have a tendency to skip these fields which are prepopulated, something which when having a blank option does not happen, so this is not the behaviour that I want.
So to change this, I added t:blankoption="always" to the select field, to restore the blank option. But now, I am bitten by the previous conclusion that client-side validation is not performed on these fields (in fact there is no client-side validation at all, ever - the paradigm explained here is used to cover the required case). So when combined with other fields which do have client-side validation, this looks quite disjointed.
So I'm trying to figure out the best way to accomplish what I want, which is a select box with a blank option, which has a client-side required validation inline with the other client-side required validations.
All that is required is the contribution to the Tapestry.validate(...) javascript code snippet by the select field, to get it to behave as wanted, but I can't figure out the proper mechanism for accomplishing this. I'm sure it's something very simple, somewhere, but what?
I can see how it is added - org .apache .tapestry.internal.services.ClientBehaviorSupportImpl#addValidation, coming from org.apache.tapestry.validator.Required#render but why is render called for a TextField with the 'required' validator, but not from a Select field?
Anyway, I'm still digging, but maybe someone has a hint. Thanks, J --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]