I've created a custom content type with CCK.
If I need to add some custom code for validating fields of this content type's record form, where do I add the code and which functions are best for this task?
I've created a custom content type with CCK.
If I need to add some custom code for validating fields of this content type's record form, where do I add the code and which functions are best for this task?
The form api is what you use to validate, you'll be crafting your own validation function. I'm going to assume you are using D6
There's a less painful way: http://drupal.org/project/validation_api
This module lets you make php code or regex for any given field.
Hope this helps.
The easiest way would probably be hook_form_alter() and the #validation attribute on the form. You would of cause have to implement this in your own module.