So I am using hook form alteruse hook_form_alter()
to updatealter a field like below.
function mymodule_form_alter(&$form, &$form_state) {
if ($form['#id'] == 'my_form') {
$form['my_field']['#value'] = 'New value';
}
}
function mymodule_form_alter(&$form, &$form_state) {
if ($form['#id'] == 'my_form') {
$form['my_field']['#value'] = 'New value';
}
}
ThisIt changes the field value to new value, but the problem is that, as soon as I enable this module all other JS, the JavaScript on forms stops working. For example dropdownsdrop-downs, autocompletesautocomplete, ajax it allAJAX no longer works.
I cant understand what cause this.
Thanks
Update: removed syntax error