[drupal-devel] Rewriting use of forms in Drupal
Moshe Weitzman
weitzman at tejasa.com
Fri Jun 3 10:54:48 UTC 2005
> a) Easier value checking.
>
> In _validate we would then build the form a second time to check that
> all the fields still have the type and value they are supposed to have.
>
> foreach ($form_elements as $name => $value) {
> switch($value['type']) {
> case 'textfield':
> if (!is_string($edit['value'])) {
> form_set_error(...);
> }
> if (is_empty($edit['value']) && $value['required']) {
> form_set_error(...);
> }
> break;
> case 'textarea':
> ....
> }
> }
>
Who does the validation? Core, or the module? How would that work for a
form outside of the node forms? ... The direction sounds good so far.
More information about the drupal-devel
mailing list