# Fill textbox without detection

**URL:** <https://discourse.mozilla.org/t/fill-textbox-without-detection/96509>\
**Category:** Development\
**Tags:** issue\
**Created:** [April 27, 2022, 5:35am UTC](https://discourse.mozilla.org/t/fill-textbox-without-detection/96509 "2022-04-27T05:35:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![big\_boy](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@big\_boy](https://discourse.mozilla.org/u/big_boy)\
**Post date:** [April 27, 2022, 5:35am UTC](https://discourse.mozilla.org/t/fill-textbox-without-detection/96509/1 "2022-04-27T05:35:11Z")

</div>

i made an extension to fill form. but the site owner detected i am filling the form programmatically . after all textboxes value set my extension click on data confirmation button but all textboxes value will delete and alarm me fill them again . when i try fill them manually with my fingers , it works.  
i am using  
` element.value = "sth"; `  
please show me another way to fill textboxes to avoid detection . ( i tried dispatchEvent but it wont update textbox )

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [April 27, 2022, 9:04am UTC](https://discourse.mozilla.org/t/fill-textbox-without-detection/96509/2 "2022-04-27T09:04:37Z")

</div>

The dispatch event should work if you call it correctly, try something like this:

```auto
textNode.dispatchEvent(new Event('input', {
  bubbles: true,
  cancelable: true,
  dataType: 'text/plain',
  data: 'your text here',
}));

```

---

<div class="post-metadata">

**Author:** ![big\_boy](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@big\_boy](https://discourse.mozilla.org/u/big_boy)\
**Post date:** [April 27, 2022, 10:38am UTC](https://discourse.mozilla.org/t/fill-textbox-without-detection/96509/3 "2022-04-27T10:38:03Z")

</div>

thanks for your answer  
i use your code but some thing not works

```auto

 let event = new Event('input', {
    bubbles: true,
    cancelable: true,
    dataType: 'text',
    data: 'hello'
      });

element.dispatchEvent(event);   

```

the textbox properties

```auto
<input autocomplete="off" disabled="" type="text" placeholder="Enter your name">

```

 ![Untitled](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/e/2/e2efffdf87a4e540c1b6fd3047376704dcdfdcde.png)

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [April 27, 2022, 11:51am UTC](https://discourse.mozilla.org/t/fill-textbox-without-detection/96509/4 "2022-04-27T11:51:48Z")

</div>

You can try dispatch also the “paste” event. I’ve been using it some time ago, something like this:

```auto
node.dispatchEvent(new ClipboardEvent('paste', {
  bubbles: true,
  cancelable: true,
  dataType: 'text/plain',
  data: 'text here',
  clipboardData: new DataTransfer(),
}));

```
