---
title: "how to set jquery combo box as selected true"  
description: "how to set jquery combo box as selected true"  
author: "E E Cummings"  
published: 2013-06-20  
updated: 2013-06-20  
canonical: https://www.mindstick.com/forum/1245/how-to-set-jquery-combo-box-as-selected-true  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# how to set jquery combo box as selected true

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances), \
\
I have a jquery combo box whose [selected value](https://www.mindstick.com/forum/525/get-selected-value-of-datagridviewcomboboxcolumn) I am storing in a [session](https://www.mindstick.com/articles/12042/session-in-c-sharp).\
\
After I [retrieve](https://www.mindstick.com/forum/34400/how-to-retrieve-form-values-in-controller-action) the value from the session(which contains [Json data](https://www.mindstick.com/forum/782/how-to-send-request-amp-amp-response-from-json-data-using-asp-dot-net)) I want to again make the [combobox](https://www.mindstick.com/articles/57/display-record-according-to-combobox-selection-in-csharp-dot-net) to be selected for the same value, i [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to do something like this but does not seem to work.\

```
var myArrayVar=JSON.parse(document.getElementById("populateDT").innerHTML);alert(myArrayVar[0].ActionMessage);if(myArrayVar[0].ActionMesssage == "Error Message"){            document.getElementById("combobox").value="error";            document.getElementById("combobox").selected=true; }
```

\
Any help on above is really appreciated.

## Replies

### Reply by AVADHESH PATEL

Hi,\
Try this,\
**document.getElementById('sel').[value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) = 'saab';** // your value here\


---

Original Source: https://www.mindstick.com/forum/1245/how-to-set-jquery-combo-box-as-selected-true

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
