Do anyone know how I can add the following to form_alter? Currently I've got two integer cck fields which are populated from sql using the php values command.
One field is for make, and the other is for model. Both makes and models are their own node types. Model has a node reference to make.
What I want to do on the Make drop down (CCK: INTEGER : SELECT), is on change, modify the contents of the model field. I've made my own bespoke form up, but it's too wieldy and want to use the basic drupal node edit forms.
Ideally I want to be able to pass this into the mix. '#attributes' => array ('onchange'=> 'populatemodels(this,\'edit-field-model\')')
Does any one know of a way of doing this in the code?
In my form_alter adding the attribute doesn't produce any onchanges in the code:
#field_make (Array, 14 elements)
*
#type (String, 20 characters ) optionwidgets_select
*
#default_value (Array, 1 element)
o
0 (Array, 1 element)
+
value (String, 1 characters ) 8
*
#required (String, 1 characters ) 1
*
#columns (Array, 1 element)
o
0 (String, 5 characters ) value
*
#title (String, 4 characters ) Make
*
#description (String, 0 characters )
*
#delta (Integer) 0
*
#field_name (String, 10 characters ) field_make
*
#type_name (String, 3 characters ) car
*
#tree (Boolean) TRUE
*
#weight (String, 2 characters ) -1
*
#access (Boolean) TRUE
*
#count (Integer) 9
*
#attributes (Array, 1 element)
o
onchange (String, 39 characters ) populatemodels(this,'edit-field-model')
Thanks - Matt