I am working on a very simple program that uses JavaScript to fill out and submit a google form. This is what I have so far:
(Test Form I Used: https://forms.gle/4TvkMYXrFWfxX1NZA)
const a = [
'John',
'Doe',
'Blue'
];
var form = document.getElementsByTagName('form')[0];
var elements = form.querySelectorAll('input[type="text"]');
for(i = 0; i < answers.length; i++){
elements[i].value = answers[1];
}
This seems to fill out the text fields, but when I try to submit it does not recognize that the fields are filled out. Is there a better way to do this?