get random ID into an empty array
<p>heres the fiddle im working on <a href="http://jsfiddle.net/d0okie0612/22cTn/" rel="nofollow">http://jsfiddle.net/d0okie0612/22cTn/</a></p>

<p>Im wrote a function getNewId() and i want to get it into my empty array [] everytime i click add location link and each one should have a different random ID per form </p>

<p>so name="locations[random_id_goes_here][street]"
right now its name="locations[][street]"</p>

<p>heres the html</p>

<pre><code>&lt;div id="container"&gt;
    &lt;div id="top_form"&gt;
        &lt;form&gt;
            Street: &lt;input class="street" name="[][street]" id="form_element" type="text"&gt;          &lt;br&gt;&lt;br&gt;
            City: &lt;input class="city" name="[][city]" id="form_element" type="text"&gt;
            &lt;select&gt;
                &lt;option value=" "&gt;State&lt;/option&gt;
                &lt;option value="ca"&gt;CA&lt;/option&gt;
                &lt;option value="az"&gt;AZ&lt;/option&gt;
                &lt;option value="de"&gt;DE&lt;/option&gt;
            &lt;/select&gt;
            Zip: &lt;input name="[][zipcode]" type="text"&gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;br /&gt;
&lt;a href="#" id="awsomeButton"&gt;+ Add Loction&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;button id="submit_btn"&gt;Submit&lt;/button&gt;
</code></pre>

<p>heres the jquery</p>

<pre><code>var tpl = ""
    + "&lt;div id='location_div_&lt;%= id %&gt;'&gt;&lt;h1&gt;My Location #&lt;%= id %&gt;&lt;/h1&gt;&lt;/div&gt;";

var newId = new Date().getTime();
var template = _.template(tpl);
var compiled = template({id: newId});

var addedForm = "&lt;div id='added_form'&gt;"
    + "&lt;a href='#' class='close_btn'&gt;x&lt;/a&gt;"
    + "Street: &lt;input name='locations[][street]' type='text'&gt;"
    + "&lt;br /&gt;&lt;br /&gt;"
    + "City: &lt;input name='locations[][city]' type='text'&gt;"
    + "&lt;select&gt;"
    + "&lt;option value=' '&gt;State&lt;/option&gt;"
    + "&lt;/select&gt;"
    + "Zip: &lt;input name='locations[][zipcode]' type='text'&gt;"
    + "&lt;/div&gt;"

function getNewId() {
    var newId = new Date().getTime();
    return newId;
}

$('#awsomeButton').on('click', function (e) {
    $(addedForm).hide().appendTo('form').fadeIn('slow');
    $(getNewId()).appendTo();
});

$('.close_btn').live('click', function (event) {
    event.preventDefault();
    $(this).parents('div#added_form:first').fadeOut('slow', function () {
        $(this).remove();
    });
});
</code></pre>

<p>so basically im just trying to get the numbers in the empty array any help would be appreciated thank you</p>

<p>Am I asking this question weird?</p>
