Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By rakun on
Can any body provide code snippet to get specific entity field in edit mode?
Let say we have 'field_myfield' (it's select box with some options and one is selected) on some node (nid:29). How can I programmatically get rendered form element (select box) with selected default value for some specific node/entity?
Comments
Re: Programmatically get specific entity field in edit mode
You can use "field_attach_form" function for your purpose.
Hope this helps you.
Thanks!