I have a simple form that I am dynamically changing elements of. When I submit this form via a submit\_tag it does not pass along the changed elements to the server. What do I need to add? Somewhat new to Rails so any help would be appreciated. 

form:

```
<form action="/cabinets" id="cabinets_form" method="post">
  <div id="main_body">
    <%= render 'layouts/body_header' %>
  </div>
</form>

```

body header:

```
<div style="width: 1250px; position: relative; left: -150px; height: 50px;">
  <%= text_field_tag 'nbr', nil, :style => 'width: 30px; font-family: monospace; position: relative; left: 60px;', maxlength: 3 %>
</div>

```

jQuery to change text\_field in main\_body

```
$('#nbr').attr('id', 'nbr_0');

```

The id is changed correctly and is seen when viewing the html but when I submit the form, the information sent over is: ":nbr => ''" instead of ":nbr\_0 => ''". Using rails 3.2.13.

Edit:

Here is the body header with the hidden element:

```
<div style="width: 1250px; position: relative; left: -150px; height: 50px;">
  <%= text_field_tag 'nbr', nil, :style => 'width: 30px; font-family: monospace; position: relative; left: 60px;', maxlength: 3 %>
  <%= hidden_field_tag "hidden_info", nil %>
</div>

```

Trying to update the value after I change the name with this code.

```
$('#hidden_info').attr('name', 'hidden_info_0');
$('#hidden_info').html("test");

```

The output for the params is: "hidden\_info\_0"=>"". I would like it to be "hidden\_info\_0"=>"test".