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
.