there are good instructions on hiding a field using a hook.

Is there a simpler way of doing this? I would like to hide a term reference field on a node edit form but use the default value for it.


If you simply want to hide the field and have the default value saved, you should be able to simply hide the field with CSS. Find the ID of the wrapper surrounding the field and set it to display: none;. Here is a working example from my D6 site:

#edit-field-vendor-sort-order-0-value-wrapper {
  display: none;
  • 3
    This can be useful, but don't use CSS if the field value has security implications. A malicious user could still change the value. – Dylan Tack Sep 30 '11 at 17:21
  • Very true, good point – Laxman13 Sep 30 '11 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.