# Return Value in Combobox

**URL:** https://forum.servoy.com/t/return-value-in-combobox/11377
**Category:** Classic Servoy
**Created:** [November 7, 2009, 9:17am UTC](https://forum.servoy.com/t/return-value-in-combobox/11377 "2009-11-07T09:17:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Yummy](https://avatars.discourse-cdn.com/v4/letter/y/7ba0ec/32.png) [@Yummy](https://forum.servoy.com/u/Yummy)
#### Post date: [November 7, 2009, 9:17am UTC](https://forum.servoy.com/t/return-value-in-combobox/11377/1 "2009-11-07T09:17:44Z")

</div>

I’m sure this is obvious but I can’t find the solution …?

I have a simple combobox with a custom values (setup with the 7 days of the week, Mon to Sun).

On the form I don’t have a dataprovider (its set to none) and have the field with the valuelist set to the valuelist with the 7 days of the week.

The combobox displays the days of the week fine, but how do I retrieve the value selected when the value changes as I don’t have a dataprovider ?

e.g var val\_selected = elements.cmb\_day\_week

if (val\_selected == ‘monday’)  
{ do something}

I have found that the onDataChange does not get activated unless I have a dataprovider. In this case I can’t see why I’d need a dataprovider as the valuelist has all the required information ie. the 7 days of the week.

---

<div class="post-metadata">

### Author: ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)
#### Post date: [November 7, 2009, 10:06am UTC](https://forum.servoy.com/t/return-value-in-combobox/11377/2 "2009-11-07T10:06:48Z")

</div>

Yummy - as you’ve discovered - if you want to do anything with returned data from Combo Box - the return must be held in a dataprovider to be available.

Easiest way to handle this is to set-up a form variable - and use that as the data provider.
