1

I want to automate submissions of TikTok copyright infringement reports with JavaScript. I have tried this code so far:

document.getElementsByName('name')[0].value = 'Name Here'

When I attempt to submit the form, the site clears the textbox and asks me to fill out this required field. Any clue what I am doing wrong? I have also tried this:

document.getElementsByName('name')[0].dispatchEvent(new Event('change'))
TylerH
  • 20,799
  • 66
  • 75
  • 101
  • Hey! That question is a possible duplicate of https://stackoverflow.com/questions/2856513/how-can-i-trigger-an-onchange-event-manually And there's also an answer which may help you: https://stackoverflow.com/a/2856602/3137698 – zinovyev Sep 15 '20 at 09:55

1 Answers1

0

Without knowing exactly how that React form handles the input, it's hard to know what event needs triggering.

You can use Puppeteer to do this much easier, see this question for examples

Luke Storry
  • 6,032
  • 1
  • 9
  • 22