views:

764

answers:

2

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?

+1  A: 

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.

John Lewis
Ooooooooooh!
ceejayoz
+2  A: 

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.

googletorp