Change cck input field on node add form D6

Events happening in the community are now at Drupal community events on www.drupal.org.
mrbangkok25's picture

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

Grayside's picture

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

mrbangkok25's picture

thankx for your info Grayside i will give the tutorial a try.

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: