How can I change this javascript so the contents of it get submitted to my rails form?
===

In rails, I have a form with the id: 'new_user', which when submitted creates a new user. I'm trying to make sure that the following javascript works:

        var form$ = $("#new_user");
                    var token = response['id'];
                    form$.append("<input type='hidden' name='Token' value='" + token + "' />");
                    form$.get(0).submit();

What I want it to do is add the 'Token' to my Rails form when I submit the form. How can I go about changing the javascript so the 'Token' gets submitted to the form with an id 'new_user'? Thanks very much!