0

I have a js for auto fill a form. But when i fill form i need to click input and press any key to trigger list which is related with card number.

Example: when page loaded all areas filling automated

when page loaded all data are filling by javascript. But installemens is no seeing till i click and press any button to card number area.

when i click card number area and press ANY key in keyboard, the result is : real press trigger list

So how can i trigger this list with JS, or how can i simulate click card number area then simulate organic press with js, or anything else for solution. Any advice will be accepted :)

Edit: ofcourse tried;

document.getElementById('elementID').click();

or Is it possible to simulate key press events programmatically?

these solutions not working on my problem :(

  • can you share your code with short explanation what you exactly want ? your question in difficult to understand – Amir Rahman Sep 17 '21 at 09:19
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 24 '21 at 11:29

1 Answers1

0

to simulate a key press you can do a simple:

var e = jQuery.Event("keydown");
e.which = 78; // n code value
e.altKey = true; // Alt key pressed
$("#inputBox").trigger(e);
MarkWriteCodes
  • 135
  • 1
  • 10