Closed (fixed)
Project:
CCK Validation
Version:
5.x-0.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2008 at 16:38 UTC
Updated:
20 Jun 2012 at 09:03 UTC
I've created a type of content with CCK, now I need to validate some inputs but I don't know how to do it, can you help me?
Comments
Comment #1
derhasi commentedYou have to create some PHP-Code for validation. On negative results you can create error messages with form_set_error(). In your code you can get acces on the field via $node. So is title set in $node->title, body in $node->body and any cck-field in $node->field_fieldname (like it is shown in the field listing of the content type).
You can find some code examples in the readme-File.
-----------------------------------------------------------------------------------------
Test minimum length of a textfield (e.g. 4 chars)
-------------------------------------------------
- Validiation Code:
- Process validation
can be set to both (field or widget)
Test date's year
----------------
- Validiation Code:
- Process validation
WIDGET - for this code it has to be set to widget, because in field-validation
date-array isn't present anymore.
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
kenorb commentedCCK 8.x: #52051: Validation API/UI