I created a simple select-field (type: list (text)) within the "manage-fields" section of a content-type. This field is marked as required.
It has two values:
1|Yes
2|No
In the browser this field is shown with following options in html:
-- please select --
Yes
No
When now submitting this form, the client side validation does not say, that this field is required.
Could this be a bug or am I using it wrong? The module uses jquery.validate as base, right? jquery.validate assumes, that a required field, if it is not changes by the user, has the value "" or a string-length which is equal to zero. The default "required" value of the list-field in drupal seems to be "_none".
Has someone an idea, what is going wrong?
Comments
Comment #1
attiks CreditAttribution: attiks commentedFirst time I hear this, but you're right. If you make the field required and don't specify a default value an extra option is added with key '_none'
Comment #2
attiks CreditAttribution: attiks commentedI created #1585930: Options module uses '_none' as a special value to see if it can be fixed in Drupal core.
Comment #3
attiks CreditAttribution: attiks commentedblacklist '_none' might solve this
Comment #4
Jelle_Sfixed in latest dev by blacklisting '_none'
Comment #5
Jelle_SComment #6
Jelle_SComment #8
garamani CreditAttribution: garamani commentedHave you committed this fix to the latest Recommended release of module?
The problem still exist in 7.x-1.39.
The form that I want to be validated is "Hierarchical select".
In this Issue some people requested to exclude HS from being validated.
Have you excluded the HS from clientside validation?
Comment #9
garamani CreditAttribution: garamani commentedI created a simple list with None as default option and the List gets validated!
So, the problem is only related to Hierarchical select which doesn't get validated by Clientside Validation.