Posted by mrbangkok25 on November 22, 2009 at 11:30am
Hi,
Can anyone help me please?
I would like to change settings like #maxlength, #default_value, #size on 2 cck mvf input fields in the node add form on D6
I use the hook_alter_form function.
The #name of the fields are
field_fieldname[0][value]
field_fieldname[0][value2]
i try
$form['field_fieldname'][0]['value']['#maxlenght'] = 2;But no luck
I am able to change #default_value for the first "from" field with
$form['field_fieldname'][0]['#default_value'] = t('2');But don't know how to access the second field
Hope somebody can help me with this, been busy for hours.
Thanks in advance.
Andy
Comments
For starters, you have a typo
For starters, you have a typo on #maxlenght. It should be: #maxlength.
Next, the CCK input forms are a little touchy. Follow this tutorial: http://drupal.org/node/357328.
Thankx
thankx for your info Grayside i will give the tutorial a try.