# Cannot read property 'target' of undefined from current.js

**URL:** <https://community.hubspot.com/t/cannot-read-property-target-of-undefined-from-current-js/11881>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [August 12, 2018, 9:25pm UTC](https://community.hubspot.com/t/cannot-read-property-target-of-undefined-from-current-js/11881 "2018-08-12T21:25:20Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [August 28, 2018, 7:39pm UTC](https://community.hubspot.com/t/cannot-read-property-target-of-undefined-from-current-js/11881/8 "2018-08-28T19:39:16Z")

</div>

Hi [@Muhammad\_Adnan](https://community.hubspot.com/u/muhammad_adnan),

Sure thing; here’s a super simple test page I set up in my portal:  
[Example Email Field Population](https://www.over-understanding.info/example-email-field-population)

I checked out your page, and from what I can see the form isn’t an embedded HubSpot form. I generally populate the email field with code like this:

```auto
$("input[name='email']").val("test@test.com").change();

```

The code you included above is different, but theoretically should work. I think the issue is that your selector includes HubSpot form markup that doesn’t appear in the DOM. Trying the following in the console worked for me:

```auto
$("input[type='email']").val("test@test.com").change();

```

---

_[View the full topic](https://community.hubspot.com/t/cannot-read-property-target-of-undefined-from-current-js/11881)._
