Using Javascript I have created an array with elements.
Now, I want to assign that array into HTML hidden input field to use this input field as form input field.
When I submitted the form, this should go to the controller as an array.
Javascript:
var schools= [];
var address1 = place.name;
var latitude1 = place.geometry.location.lat();
var longtitude1 = place.geometry.location.lng();
schools.push([address1,latitude1,longtitude1]);
document.getElementById("addSchools").value = schools;
HTML:
<input type="hidden" class="form-control" placeholder="Search Box"
id="addSchools" name="addSchools[]" value="">