1

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.

1 Answer 1

5

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;
}
2
  • 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
    Commented Sep 30, 2011 at 17:21
  • Very true, good point
    – Laxman13
    Commented Sep 30, 2011 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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