All pastes #374529 Raw Edit

Unnamed

public text v1 · immutable
#374529 ·published 2007-02-27 17:16 UTC
rendered paste body
#
#  a simple cck decimal type can be added into a table when editing
#  by rendering the form input field like so:  
#
#  // a possible form input field within a table for positioning (stuff omitted)
#  <td>
#    <?php print drupal_render($form['field_mynumeric_min']['0']['value']); ?>
#  </td>
#
#  A form built this way can put input fields where the clerical staff expect them.  
#  That's a positive step towards end user acceptance and usability.  
#
#  I'd like to do the same this with a form selectlist, and or a form checkbox, but I've 
#  been unable to devine the incantation required.  
#  
#  I don't think I want form_alter; I don't want to alter the selectlist; it works just fine.  
#  I don't think I want theme_form; the default theming of form components is great.
#  
#  But I do want the selectlist to appear where I place it in mynode_edit.tpl.php
#
#
#  //extrapolating from above, but changing to a cck select field  
#  // this doesn't render a select box (or anything else)
#  <td>
#    <?php print drupal_render($form['field_iris_ctl']['0']['value']); ?>
#  </td>
#
#  How do I render a select list inside the table?  A sample print_r of the select list is shown below.
#
#

    [field_iris_ctl] => Array
        (
            [#tree] => 1
            [key] => Array
                (
                    [#type] => select
                    [#title] => iris_ctl
                    [#default_value] => 1
                    [#multiple] => 
                    [#options] => Array
                        (
                            [0] => Fixed
                            [1] => Manual
                            [2] => DC Motor
                            [3] => VideoAI
                            [4] => Other
                        )

                    [#required] => 1
                    [#description] => What type of iris is this?
                    [#post] => Array
                        (
                        )

                    [#programmed] => 
                    [#tree] => 1
                    [#parents] => Array
                        (
                            [0] => field_iris_ctl
                            [1] => key
                        )

                    [#weight] => 0
                    [#processed] => 
                    [#attributes] => Array
                        (
                        )

                    [#input] => 1
                    [#name] => field_iris_ctl[key]
                    [#id] => edit-field-iris-ctl-key
                    [#value] => 1
                    [#sorted] => 1
                )

            [#weight] => 0
            [#post] => Array
                (
                )

            [#programmed] => 
            [#parents] => Array
                (
                    [0] => field_iris_ctl
                )

            [#processed] => 
            [#sorted] => 1
            [0] => Array
                (
                    [value] => 
                )

        )