Schleid Alex

Schleid Alex

  • NA
  • 361
  • 48.3k

Passing 4 paramaters in jquery post

May 11 2020 2:03 PM
Hi,
 
I need to pass start year, start month, end year and end month to a jquery post. for some reason it is seeing only 3 out of the 4 parameters, script is posted below:
 
 $(document).ready(function () {
        var ddlStartMonthValue;
        var ddlStartYearValue;
        var ddlEndMonthValue;
        var ddlEndYearValue;
        $('#ddlStartMonth').change(function () {
            ddlStartMonthValue = $('#ddlStartMonth').val()
            //$('#inpmonth').val(ddlMonthValue)
        })
        $('#ddlStartYear').change(function () {
            ddlStartYearValue = $('#ddlStartYearValue').val()
        })
        $('#ddlEndYears').change(function () {
            ddlEndYearValue = $('#ddlEndYears').val()
            //$('#inpyear').val(ddlYearVal)
            //alert('The year selected is ' + ddlYearValue)
        })
        $('#ddlEndMonth').change(function () {
            ddlEndMonthValue = $('#ddlEndMonth').val()
        })
        $('#btnShowTransList').click(function () {
            debugger;
            $.ajax({
                type: 'GET',
                url: '@Url.Action("AccountTransactionListing", "AccountTransactions")',
                contentType: 'apllication/html; charset=utf-8',
                data: {
                    'CustomerAccountID': @Model.CustomerID,
                    'StartYear': ddlStartYearValue,
                    'EndYear': ddlEndYearValue,
                    'StartMonth': ddlStartMonthValue,
                    'EndMonth': ddlEndMonthValue
                },
                dataType: 'html',
                success: function (result) {
                    $('#dvAccountListing').html(result)
                }
            })

        })
    })
 
Thank you!
 

Answers (3)