We are workding with
php 5.3.x
pressflow 6.22
We are testing our project without javascript, and we have realize that the "add more" buttons don't work when we use a after_build function to change the button's text.
In our mymodule_form_alter we have this code:
<?php
$form['#after_build'][] = 'js_chosen';
<?
And our function code is:
<?php
drupal_add_js('sites/all/libraries/chosen/chosen/chosen.jquery.js');
drupal_add_css('sites/all/libraries/chosen/chosen/chosen.css');
if ($form_element['#token'] == 'publicacion_node_form') {
$form_element['field_publicacion_imagenes']['field_publicacion_imagenes_add_more']['#value'] = t('Añadir imagen');
$form_element['field_publicacion_autores']['field_publicacion_autores_add_more']['#value'] = t('Añadir autor');
$form_element['field_author_invite']['field_author_invite_add_more']['#value'] = t('Añadir invitado');
}
<?
If we comment the line $form_element['field_publicacion_imagenes']['field_publicacion_imagenes_add_more']['#value'] = t('Añadir imagen');
the form work greats. But if we change the text the buttons save the node as the "save" buttons.
I have test this also in a clean drupal 6.22 and with image field and user-reference fields with Unlimited elements.
Thanks
Oskar