By Yanivs on
Dear Drupal community,
I created a CCK text field and I want users to be able to enter in it only a-z, 0-9 and "-". No uppercase, no spaces, not an underscore, no symbols...
How do I do this? is there a setting in the CCK text field module? is there another module that is doing this?
Thanks a lot in advance for you help,
Yaniv
Comments
_
Maybe the http://drupal.org/project/validation_api module? Otherwise some custom code with hook_field or using the formsapi will probably be required.
Validation API is the answer
Thanks WorldFallz, Validation API did the trick.
For other people that are looking for this functionality:
That's all. In order to be sure that everything is working OK, go to the page that contains the field you want to validate and test the validation by submitting information that should not pass and after that information that should pass.
I hope this will be helpful to other Drupllers out there.
Yaniv
_
awesome-- thanks for posting back the details of your solution!