Drupal: validating custom content

I created my own content type using CCK.

If I need to add some custom code to validate the fields of this content type post form, where can I add the code and what functionality is best for this task?

+2


source to share


3 answers


The easiest way is hook_form_alter () and #validation on the form. You would have to implement this in your own module.



+5


source


The form api is what you use for validation, you will create your own validation function. I assume you are using D6

There's a less painful way to go: http://drupal.org/project/validation_api



This module allows you to make php code or regex for any given field.

Hope it helps.

+3


source


To create a custom module to implement form validation, I suggest this method: create a new module to validate a content type field in drupal

0


source







All Articles