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.
The inpu field only alows 250 characters. I usually have over 250 ID numbers to validate. Need to accept more characters for specific values.
Comment | File | Size | Author |
---|---|---|---|
#6 | webform_validation_1227574_longer_data.patch | 1.26 KB | Liam Morland |
Comments
Comment #1
svendecabooterThis is caused by the database schema field length.
This could be made larger, but I suppose then someone will come up with a use case where even more numbers need to be validated.
Perhaps it would make more sense in your case to write a custom validation rule? Perhaps you could more easily get the ID numbers from the DB, an external file, etc... or generate them via PHP? That might be easier than typing them all in?
This supposes you know a bit of PHP though of course...
Comment #2
Liam MorlandIs there any need to limit the data field to 255 characters? Why not use text instead of varchar?
Comment #3
Liam MorlandMarking #1418780: Longer RegEx Validation Rules as a duplicate of this.
Comment #4
BrianLP CreditAttribution: BrianLP commentedIn my case, I can't generate them with php and I haven't found another way of validation. Perhaps someone has an idea...
I'd like to use the webform for mailing response landing pages where the user enters his personal ID to see the content. Usually 200-500 IDs.
They are the customer IDs from an external filemaker database (selected on customer attributes). They have no specific pattern other than consisting 5 or 6 digits. The best (and only) way I can think of is to paste the IDs into the validation field when creating the page. My database puts them into the clipboard, separated with commas.
Comment #5
Liam Morland@papalapapp The suggestion in #1 is to create a custom module which uses the hooks provided by Webform Validation. That would allow you to put the IDs into the code or wherever is convenient for you.
Comment #6
Liam MorlandFixed in ca095b7f87b88f54fbab97bcd4ab487ae1f5baa6
Comment #7
Liam MorlandComment #8
BrianLP CreditAttribution: BrianLP commentedThank you! Do I see it right that this is applied to the 7.x-1.x-dev (2013-Jan-22) already?
Comment #9
Liam MorlandYes, it is in 7.x-1.x-dev now.
Comment #10
Mentor.37 CreditAttribution: Mentor.37 commentedI installed last 7.x-1.2 module but i can not insert more then 255 char in data field.
What can I do? I'm trying to insert a list of emails to ban in words blacklist.
Comment #11
Liam MorlandIf you installed the development version of this module after rule negation had been added but before the data field was extended, then the update hook will not have changed the field type.
Please check your database to see if the data field has become of SQL type text instead of varchar(255). If not, manually change the field type. Use a tool like phpMyAdmin to do this.
Comment #12
Mentor.37 CreditAttribution: Mentor.37 commentedI have not installed dev version.
I'm on sql database and in database data field is not varchar(255) but is text. I can manually add in database more then 255 char but i can not do this in drupal.
Can you help me?
Comment #13
Liam MorlandTurns out there was still a #maxlength on the input element, now removed.
http://drupalcode.org/project/webform_validation.git/commitdiff/8e36f8f
Comment #14
Liam MorlandInclude both patches when porting.
Comment #15
BrianLP CreditAttribution: BrianLP commentedWorks perfectly. Thanks!
(This makes things so much easier. No more regex and blacklists, only a precise list of allowed numbers.)
Comment #16
Liam MorlandDrupal 6 is no longer supported.