I try to run javascript in a browser extension to automate the process of filling out a form on a website, and then click a button - the extension code can be modeled by entering javascript: code in the address bar.
On a website where I am having problems using angularJS. I have input field identifier names, and I use them to change input field values. Fields are filled, but when I click the button, it says that they are not filled, there are no values, and all of them are mistaken. Some validation continues that does not βseeβ my changes if I do not enter the values ββmanually.
Is there an easy way to change the value of AngularJS input fields that have validation using only the input field identifier.
Here is the code:
<input id="shippingAddr-first-name" type="text" class="first-name ng-pristine ng-valid" maxlength="16" data-ng-model="addressTypes[addressType].FirstName" focus-me="commonAddressTypeProps[addressType].focusOnFirstName" client-validation="onExit" data-required-on-exit="">
My attempts to use document.getElementById("shippingAddr-first-name").value="Dave"; change the field, but do not register correctly when submitting the form. However, it works if I type it manually. I also tried clicking (), blur (), focus () to mimic some things that I can do manually, but they don't work either.
source share