Hi! I'd like to dynamically hide a CCK textarea field, based on some logic around user permissions and arguments passed into the edit form.

Here what I'm trying this in node-form.tpl.php:

		$form['field_note'][0]['#type'] = 'hidden';

...But the textarea is still returned as part of $standard, and also in $field_note.

Any suggestions or advice would be great appreciated -- thanks in advance!

Comments

Rosamunda’s picture

+1
Subscribing :)

MissterX’s picture

No, it did not take me 3 years to find the answer. The reason is I noticed your question a moment ago. Anyway, have you tried with:

$form['field_note'][0]['#type'] = 'token';

If you would like to have it a value, add this row:

$form['field_note'][0]['#value'] = 'my-value';