1

i am trying to fill an Input-text in HTML page via javascript (chrome extension).

const inputNom = document.querySelector('....');

inputNom.value = 'Jean ...';

works fine and i can see the input value in the Input-text.

By clicking the submit button, its looks like the informations validator in the submit button only detects the value if it is entered manually.

is there some way to simulate a manually keypress on this input.

thank you every body

Key Progs
  • 11
  • 3
  • 3
    Depends how the validator is validating - we'd need to see its code to see how to get it to pass the tests it's running – CertainPerformance Oct 23 '20 at 17:01
  • Does this answer your question? [Is it possible to simulate key press events programmatically?](https://stackoverflow.com/questions/596481/is-it-possible-to-simulate-key-press-events-programmatically) – Nathan Chu Oct 23 '20 at 17:05
  • i try __inputNom.dispatchEvent(new KeyboardEvent('keypress',{'key':'a'})); __ and no luck – Key Progs Oct 24 '20 at 08:26

0 Answers0