I have a javascript array variable that is created in an action => new form but I can't seem to find a way to return this variable as a field to the controller along with the other form field inputs. How do I set this array to a hidden field in the form. Is there a way to pass the array back into the parameters hash to the controller?

$(document).ready(function() {

    arr = new Array();

        $(document).on('change', 'select[id ^="package"]', function() {
            var arr = $('select[id ^="package"]').map(function(){
                return this.value
            })          
        });

});

I have this javascript array and I want to submit the form with :packages set to the javascript variable arr.

link|improve this question
post code please – reagan 49 mins ago
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.