So I am using hook form alter to update a field like below

    function mymodule_form_alter(&$form, &$form_state) {
      if ($form['#id'] == 'my_form') {
        $form['my_field']['#value'] = 'New value';
      }
    }

This changes the field value to new value, but the problem is that as soon as I enable this module all other JS on forms stops working. For example dropdowns, autocompletes, ajax it all no longer works.

I cant understand what cause this.

Thanks 

Update: removed syntax error