Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I added a phone number filed and a simple text field (dropdown selection) to a cck 3 multigroup field and I get this error...
"999 999 9999" is not a valid North American phone number, it should be 10 digits number like "999 999 9999"
Clearly the numbers are identical so it should validate.
If I turn off validation it will save however the phone number does not display on the node.
I am trying to solve the phone number type issue here. If there is a better way please do tell.
Comments
Comment #1
CraigBertrand CreditAttribution: CraigBertrand commentedoops selected wrong version
Comment #2
CraigBertrand CreditAttribution: CraigBertrand commentedOkay this is getting embarrassing
Comment #3
CraigBertrand CreditAttribution: CraigBertrand commentedOkay upon further testing I think this is a cck bug. I tried to make my own phone number field using just the text and integer field types and doing validation by the number of digits in the integer field and got the same error.
I created:
one field called type (text field) (select list)
3 fields for the three parts of a standard US/Canada number (integer) (text field)
On each of the integer fields I set min and max values of 3/3/4 respectively to correspond to the phone number.
Here is the error message from that config:
Area Code: the value may be no larger than 3.
First Three: the value may be no larger than 3.
Last Four: the value may be no larger than 4.
It seems that multigroup cannot validate input?