65002418

Date: 2020-11-25 10:09:29
Score: 4
Natty:
Report link

derloopkat, Dawood Awan : Thanks to your advices, I finally have the solution which works :

 function fctValidate() {
    var lstOption = [];
    try {
        $(".option-value").each(function () {
            lstOption.push({
                ID_OPTION: $(this).data('id'),
                LI_VALUE: $(this).val()

            });
        });
    } catch (error) {
        alert(error);
    }

     $.ajax({
        type: "POST",
        url: '@Url.Action("CreateOption", "CreateOption")',
        data: { 'lstOption': lstOption },
        dataType: "json",
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            alert(err.Message);
        }
    });
}
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (3): Thanks to your advices
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: eric.bryan