Hello all,
I don't have experience in php. I've followed a few tutorials to modify my Drupal forms using the theme method in template.php.
For some reason the [#weight] property for a field does not adhere to its values. I'd like to move the Category field [cid] above Subject field [subject]. These are the lines of code I used:
$form['cid']['#weight'] = 0.003;
$form['subject']['#weight'] = 0.004;
When I print my array to view I see the values have changed, but when I render the form no changes are made. I have already cleared performance cache after every modification.
If you're interested here is a snippet of my printed array:
[subject] => Array
(
[#type] => textfield
[#title] => Subject
[#maxlength] => 255
[#required] => 1
[#post] => Array
(
)
[#programmed] =>
[#tree] =>
[#parents] => Array
(
[0] => subject
)
[#array_parents] => Array
(
[0] => subject
)
[#weight] => 0.004
[#processed] => 1
[#description] =>
[#attributes] => Array
(
)
[#input] => 1
[#size] => 60
[#autocomplete_path] =>
[#process] => Array
(
[0] => form_expand_ahah
)
[#name] => subject
[#id] => edit-subject
[#value] =>
[#defaults_loaded] => 1
[#sorted] => 1
)
[cid] => Array
(
[#type] => select
[#title] => Category
[#default_value] => 1
[#options] => Array
(
[1] => General Enquiries
[2] => Support
)
[#required] => 1
[#post] => Array
(
)
[#programmed] =>
[#tree] =>
[#parents] => Array
(
[0] => cid
)
[#array_parents] => Array
(
[0] => cid
)
[#weight] => 0.003
[#processed] => 1
[#description] =>
[#attributes] => Array
(
)
[#input] => 1
[#size] => 0
[#multiple] =>
[#process] => Array
(
[0] => form_expand_ahah
)
[#name] => cid
[#id] => edit-cid
[#value] => 1
[#defaults_loaded] => 1
[#sorted] => 1
)
Much appreciated,
Chris