Question: I want to get the text of selected option from the dropdownlist in the controller method.
But with the below code, I get only the initial text not the changed text.

data.jsonOfLog which is before data.submit, gets the changed text, but it is not this text which is passed to the controller.

In Controller:

```
[HttpPost]
public JsonResult GoodSave(string jsonOfLog)
{

```

In View:

```
<script type="text/javascript">
        $(function () {                 
            json = { jsonOfLog: $("#ddlDocumentType option:selected").text() };
            $('#fileupload').fileupload({
                dataType: 'json',
                contentType: 'application/json; charset=utf-8',
                url: '/Home/GoodSave',
                data: JSON.stringify(json),
                add: function (e, data) {
                    $('#fileuploadbutton').click(function () { 
                        data.jsonOfLog = $("#ddlDocumentType option:selected").text();
                        data.submit();
                    })
                }                
            });
        });
    </script>

```

![enter image description here](https://i.stack.imgur.com/cDS3p.jpg)

Answer: 
This will change the `formData` when you try to upload...

```
<script type="text/javascript">
    $(function () {                 
        $('#fileupload').fileupload({
            contentType: 'application/json; charset=utf-8',
            url: '/Home/GoodSave'
        })
        .on("fileuploadsubmit", function (e, data) {
            data.formData = {
                jsonOfLog: $("#ddlDocumentType option:selected").text()
            };
        });

        $("#fileuploadbutton").on("click", function() {
            $("#fileupload").submit();
        });
    });
</script>

```

I don't think you need to stringify the data, so try the above and if that doesn't work then use stringify as you did previously. It shouldn't be needed as you're passing the data with property names which should match the parameters in the server method.

This comes from the blueimp file upload documentation...

<https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-form-data>
Finally, what worked is this:

```
<script type="text/javascript">
    $(function () {
        $('#fileupload').fileupload({
            add: function (e, data) {
                $('#fileuploadbutton').click(function () {
                    $.ajax({
                        type: 'POST',
                        cache: true,
                        url: '/Home/GoodSave',
                        data: { jsonOfLog: $("#ddlDocumentType option:selected").text() },
                        success: function (data) {

                        },
                        error: function (data) {
                            alert("error");
                        }
                    });
                });
            }    
        });    
    });    
</script>

```