I am attempting to dynamically create form data with the following method, where input_values is an array of values:
for (var i in input_values) {
var input = document.createElement('input');
input.type = 'hidden';
input.name = "lat_lngs[]";
input.value = input_values[i];
document.getElementById('ride_form').appendChild(input);
}
This works fine for most situations. However, the input_values array contains tens of thousands of entries. When the number of inputs goes above 3000 or so, the browser starts to hang. Is there another method that can achieve this result? Or is this simply too much to ask of the DOM?