# Form Designer: DropDownList control's selected value not submitted to the server when its EnableViewState property is disabled and the control is in read-only

**URL:** <https://discuss.workflowgen.com/t/form-designer-dropdownlist-controls-selected-value-not-submitted-to-the-server-when-its-enableviewstate-property-is-disabled-and-the-control-is-in-read-only/2052>\
**Category:** Form Designer\
**Created:** [May 3, 2022, 3:12pm UTC](https://discuss.workflowgen.com/t/form-designer-dropdownlist-controls-selected-value-not-submitted-to-the-server-when-its-enableviewstate-property-is-disabled-and-the-control-is-in-read-only/2052 "2022-05-03T15:12:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyelle](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/lyelle/32/455_2.png) [@lyelle](https://discuss.workflowgen.com/u/lyelle)\
**Post date:** [May 3, 2022, 3:12pm UTC](https://discuss.workflowgen.com/t/form-designer-dropdownlist-controls-selected-value-not-submitted-to-the-server-when-its-enableviewstate-property-is-disabled-and-the-control-is-in-read-only/2052/1 "2022-05-03T15:12:57Z")

</div>

# Issue

When `EnableViewState` is set to `False` on a drop-down list and this list becomes `read-only` during an action, an unexpected behavior occurs.

The selected item in the drop-down list will no longer be selected after the read-only action, although it will be visible in the `form_archive` and in the next action. This can then have other impacts on your workflow.

The cause is that the data was not properly sent to the server.

Here is a visual representation of this error.

In the following screenshot, we can see that one list has `enableviewsstate` set to `false` and the other one does not:

 ![Capture d’écran, le 2022-05-03 à 11.25.53](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/27ec918ee3f6eb33fa442b28fc7e6f1664d70503.jpeg)

On the second action of this process, the `Request` section becomes read-only, so both lists will be affected by this configuration:

 ![Capture d’écran, le 2022-05-03 à 11.30.43](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/974b718fd090e06bf7a4e63e0118e6aa59b75738.jpeg)

Now, let’s do a test.

After the first action, the `form_archive` contains all of the information and both lists are set to `Item 1`:

 ![Capture d’écran, le 2022-05-03 à 11.32.13](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/d7d0cbdda07e56cb1d20ae982d732f1be22936ae.jpeg)

During the second action, the `Request` section is read-only. After submitting the second action, the `form_archive` does not contain the correct information for the first list:

 ![Capture d’écran, le 2022-05-03 à 11.32.35](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/2917c41c4514703f61c1cd8d8764d8bdc2773937.jpeg)

Then, when launching the following action, the information that was selected is lost:

 ![Capture d’écran, le 2022-05-03 à 11.32.48](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/1b65241eb7aaa0b27c912f93b3b781e147662dbf.jpeg)

# Workaround

There is a possible workaround for this unexpected behavior by re-enabling the field during the form submit using the following JavaScript code:

```auto
$('#submitButton').click(function(){
    $('#[ID_OF_YOUR_FIELD]').prop("disabled",false);
});

```

In the **Form configuration** panel, you must have **Enable AJAX mode** checked on the **General** tab and **Include jQuery API and jQuery UI libraries** checked on the **Web References** tab.

`ID_OF_YOUR_FIELD` represents the full ID of your drop-down list. For example, if it’s located in the `REQUEST` section and your drop-down list ID is `DDL1`, then the full ID will be `REQUEST_DLL1`, and it will look as follows:

```auto
$('#submitButton').click(function(){
    $('#REQUEST_DLL1').prop("disabled",false);
});

```

Note that this solution will change the property of this field for all actions of your workflow.
