'Google Forms: Field is required error when setting it programmatically

I'm working on chrome extension for automating google forms submission.There is an <input> field of type date which is a required field. I'm setting the date programmatically before submitting it. But google forms assumes the date field is not set since I didn't edit it manually, and it's giving a *Field is required error while submitting. I'm able to submit if I set the date manually but I want it to be automated and programmatic.

I tried checking if there is a property on the input element which google forms checks to see if the value is set or not, but no luck. I believe frameworks like Angular/React have properties like dirty/pristine for this purpose but I need this in vanilla JS. I'm looking for a property which I'll be able to set in the javascript of the chrome extension.

I also want to note that a solution like making the input field not required won't be possible since the form is external and I can't alter the form in any way. I only have access to the chrome extension source code.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source