I’m struggling with a rather simple (or at least should be simple) issue.
I’m trying to automatically fill a form online using console but after I submit, the values I set for the input fields don’t seem to “stick”. This works if I manually type into the input boxes.
Please help
This is what the input elements look like
<div _ngcontent-lrd-c152="" class="col-4 ng-star-inserted">
<label _ngcontent-lrd-c152="" for="item.Name" class="gap">Name 1</label>
<input _ngcontent-lrd-c152="" id="item.Name" type="text" formcontrolname="Name" maxlength="25" pinputtext="" class="p-inputtext p-component p-element w-12 ng-pristine ng-valid p-filled ng-touched"></div>
I tried with the below to fetch all the input fields by id
var names = document.querySelectorAll('input[id="item.Name"]');
Then looped through the elements to set their values
for (let i = 0; i<names.length;i++) {names[i].value = 'some value'}
After running the input fields show the “some value” text, but when submiting the form the values I set are not picked.