# How to select from a dropdown in form embed code?

**URL:** <https://community.hubspot.com/t/how-to-select-from-a-dropdown-in-form-embed-code/11806>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [March 7, 2018, 12:25pm UTC](https://community.hubspot.com/t/how-to-select-from-a-dropdown-in-form-embed-code/11806 "2018-03-07T12:25:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![domel99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/domel99/32/30191_2.png) [@domel99](https://community.hubspot.com/u/domel99)\
**Post date:** [March 7, 2018, 12:25pm UTC](https://community.hubspot.com/t/how-to-select-from-a-dropdown-in-form-embed-code/11806/1 "2018-03-07T12:25:23Z")

</div>

Hi. I can change the value of a simple text field using onFormReady in the form embed code, but can’t figure out how to use the same code to select an option from a dropdown. Can anyone help?

This works for a text field:  
hbspt.forms.create({  
portalId: “xxxx”,  
formId: “xxxxx”,  
css: “”,  
onFormReady: function($form) {  
$(‘input[name=“firstname”]’).val(“Dave”).change();

But this does not work for a dropdown:  
hbspt.forms.create({  
portalId: “xxxx”,  
formId: “xxxxx”,  
css: “”,  
onFormReady: function($form) {  
$(‘input[name=“dropdown”]’).val(“option1”).change();

The field is definitely named correctly and the internal values match up with what I’m trying to select. Any ideas?

---

<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:** [March 8, 2018, 5:24pm UTC](https://community.hubspot.com/t/how-to-select-from-a-dropdown-in-form-embed-code/11806/2 "2018-03-08T17:24:56Z")

</div>

Hi [@domel](https://community.hubspot.com/u/domel),

That same structure is working for me; are you sure that `option1` is the internal name of the option, and not the option label?

---

<div class="post-metadata">

**Author:** ![domel99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/domel99/32/30191_2.png) [@domel99](https://community.hubspot.com/u/domel99)\
**Post date:** [March 9, 2018, 8:54am UTC](https://community.hubspot.com/t/how-to-select-from-a-dropdown-in-form-embed-code/11806/3 "2018-03-09T08:54:06Z")

</div>

Thanks for your reply, I solved it in the end. The extra step was to replace ‘input’ with ‘select’ in the final line.
