Q:

How to add elements to nullable list with ajax

in recent days i want to make simple shop dictionary with publisher and authors. It doesn't work as I want:

When I try to Add elements when List = null the code don't work.
The code always add the first element from the list to model. Solved

This is my ajax script:
function submitAjaxForm(formId) {
    var form = $("<form></form>");
    var targetID = formId.substr(1);
    form.append($(formId).html());
    var nameValue = $(formId).find('.showDictionariesList').first().find('input[type="hidden"]').first().attr('name');
    var indexToCut = nameValue.indexOf('[', nameValue.indexOf('[', 0)+1);
    var featureIndex = nameValue.substring(0, indexToCut);
    $.ajax({
        type: "POST",
        url: '/Product/AddDictionaryItemToProduct',
        UpdateTargetId: targetID,
        data: form.serialize(), // serializes the form's elements.
        success: function (data) {
            alert("sucess");

            var showDictionariesList = $(formId).find('.showDictionariesList').first();
            showDictionariesList.html(data);
            showDictionariesList.find('input').each(function (ind) {
                $(this).attr('name', featureIndex + $(this).attr('name'));
            });
        },
        error: function (data) {
            alert("fail");
            alert(JSON.stringify(data));
        }
    });

}

This is my class: 
public class AddProductFeatureTextModel
{
    public string TypeId { get; set; }

    public List<ShowDictionaryModel> ShowDictionaries { get; set; }

    public DictionaryItemModel[] DictionaryItems { get; set; }

    public long SelectedDictionaryItemId { get; set; }
}

public class DictionaryItemModel
{
    internal static DictionaryItemModel FromDto(DictionaryDto dto)
    {
        DictionaryItemModel model = new DictionaryItemModel();
        model.Value = dto.Value;
        model.Id = dto.Id;
        return model;
    }
    public string Value { get; set; }

    public long Id { get; set; }
}

This is my view:
@model MultiShop.Panel.Models.Product.AddProductFeatureTextModel
<div id="featureText-@Model.TypeId">

            @Html.HiddenFor(m => m.TypeId)
            @Html.HiddenFor(m => m.IsRequired)
            @Html.HiddenFor(m => m.Name)
            @Html.Label(Model.Name)
            @Html.TextBoxFor(m => m.Value)
            @if (Model.IsRequired)
            { 
                <span class="requiredField"></span>
            }
            @Html.ValidationMessageFor(m => m.Value)
            <div class="showDictionariesList">
                @Html.EditorFor(m => m.ShowDictionaries)
            </div>
            @Html.DropDownListFor(m => m.SelectedDictionaryItemId, new SelectList(Model.DictionaryItems, "Id", "Value", Model.SelectedDictionaryItemId))

            <input type="button" value="Save" onclick="@("submitAjaxForm('#featureText-" + @Model.TypeId + "')")" />
        </div>

A:

I get answer for second problem:
The code always add the first element from the list to model.
I change serialize to serializeArray and use this code to change te dictionary value.
var contentVal = $("#dropDownList option:selected").val();
    var returnValue = form.serializeArray();
    returnValue[returnValue.length - 1].value = contentVal 

