# Get the selected item within a dropdown on submit

**URL:** https://forums.knack.com/t/get-the-selected-item-within-a-dropdown-on-submit/11948
**Category:** Get Answers
**Created:** [January 27, 2022, 3:55am UTC](https://forums.knack.com/t/get-the-selected-item-within-a-dropdown-on-submit/11948 "2022-01-27T03:55:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mikeacce](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Mikeacce](https://forums.knack.com/u/Mikeacce)
#### Post date: [January 27, 2022, 3:55am UTC](https://forums.knack.com/t/get-the-selected-item-within-a-dropdown-on-submit/11948/1 "2022-01-27T03:55:31Z")

</div>

I have an edit form with a dropdown field that lists the available connected records from another object. (a connection field)

When I submit the edit form I want to get the value of the selected dropdown so I can use zapier to update the corresponding record.

This is the code I have  
/ Change view\_1 to the form view you want to listen to  
$(document).on(‘knack-record-update.view\_788’, function(event, view, record) {  
alert(‘Form submitted!’);  
var value = $(‘input[name=“field\_552”]’).val();  
console.log(value)

});

the output of this when I submit the form is “%5B%7B%22id%22%3A%2261f1dd389bf9b78ce8aa0c03%22%2C%22identifier%22%3A%22Woodside-17%22%7D%5D”

What I am looking for is “woodside-17”

I have also tried these options  
var value = $(‘view\_788-field\_522’).val();  
var value = $(‘field\_522’).val();  
var value = $(‘view\_788-field\_522 :selected’).text();  
var value = document.getElementById(‘field\_552’).value;

All of these returned a null value.

any help on this would be great.

---

<div class="post-metadata">

### Author: ![KnackPros](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/knackpros/32/807_2.png) [@KnackPros](https://forums.knack.com/u/KnackPros)
#### Post date: [January 27, 2022, 5:48am UTC](https://forums.knack.com/t/get-the-selected-item-within-a-dropdown-on-submit/11948/2 "2022-01-27T05:48:37Z")

</div>

Does this work for you?

```auto
$(document).on('knack-form-submit.view_788', function(event, view, record) {
  var dropdownValue = record.field_552
  console.log(dropdownValue)
})

```

---

<div class="post-metadata">

### Author: ![Mikeacce](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Mikeacce](https://forums.knack.com/u/Mikeacce)
#### Post date: [January 28, 2022, 3:38am UTC](https://forums.knack.com/t/get-the-selected-item-within-a-dropdown-on-submit/11948/3 "2022-01-28T03:38:49Z")

</div>

> [@KnackPros](#):
>
> ```auto
> function(event, view, record) {
> var dropdownValue = record.field_552
> console.log(dropdownValue)
> })
> 
> ```

Yes… this worked… thank you…
