Update form attributes with javascript and get them on submit
As Clive said in the comment, you can't fix it. To do such things in the background of a form, use a hidden element:

https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#hidden