# Unhide input fields when a user starts filling.

**URL:** <https://community.hubspot.com/t/unhide-input-fields-when-a-user-starts-filling/9871>\
**Category:** CMS Development\
**Created:** [August 16, 2018, 4:41pm UTC](https://community.hubspot.com/t/unhide-input-fields-when-a-user-starts-filling/9871 "2018-08-16T16:41:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asha-wijekoon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/asha-wijekoon/32/30597_2.png) [@asha-wijekoon](https://community.hubspot.com/u/asha-wijekoon)\
**Post date:** [August 16, 2018, 4:41pm UTC](https://community.hubspot.com/t/unhide-input-fields-when-a-user-starts-filling/9871/1 "2018-08-16T16:41:32Z")

</div>

I am working on a HubSpot form where I want to unhide some input fields when a user starts filling.  
Below is the current code,

\<script charset=“utf-8” type=“text/javascript” src=“[//js.hsforms.net/forms/v2.js](https://js.hsforms.net/forms/v2.js)”\>\</script\>  
\<script\>

hbspt.forms.create({  
portalId: ‘478594’,  
formId: ‘8ce1fe21-ea32-4626-82d1-1bcf5960438f’,  
target:‘#sticky-form’,  
onFormReady($form, ctx){  
$(‘.hs-input’).focus(function(){  
$(‘.hs-company’).css(“display”, “block”).fadeIn(0);  
});  
}  
});  
\</script\>

I want to do this without including “[//js.hsforms.net/forms/v2.js](https://js.hsforms.net/forms/v2.js)” as it changes the styles of the other forms on the page.

If someone has an idea on how to do this, please let me know! Thanks!

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [August 16, 2018, 4:59pm UTC](https://community.hubspot.com/t/unhide-input-fields-when-a-user-starts-filling/9871/2 "2018-08-16T16:59:06Z")

</div>

@asha-wijekoon - you’re targeting all forms when you use “$(‘.hs-input’)”. You should only target the current form by using the $form variable that gets injected into the callback function.

```auto
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>

hbspt.forms.create({
 portalId: '478594',
 ormId: '8ce1fe21-ea32-4626-82d1-1bcf5960438f',
 target:'#sticky-form',
 onFormReady($form, ctx){
 $('.hs-input').focus(function(){
 $('.hs-company').css("display", "block").fadeIn(0);
 });
 $form.on('focus', function(){
 $form.find('.hs-company').css("display", "block").fadeIn(0);
 });
 }
});
</script>

```

* * *

If this answer helped, please, mark as solved 😄

* * *

[tim@belch.io](mailto:tim@belch.io) | [forms.belch.io](https://forms.belch.io) | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me [on slack](http://slack.belch.io/).
