Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I already exhaust my resources. Date is not diplaying anything to input field though there's a returning value from ajax.

Here's my ajax:
JavaScript
function GetDataToEdit(id) {
    $.ajax({
        url: "Dashboard/GetDataToEdit",
        data: { id: id },
        type: "GET",
        datatype: "json",
        success: function (data) {
            $.each(data, function (value, key) {
                $.each(key, function (value, i) {
                    var a = dateSplitter(i.dateCompleted);
                    var b = dateSplitter(i.dueDate);
                    var c = dateSplitter(i.dateStarted);

                    $("#inputEID").value = i.eid;
                    $("#inputProj").value = i.projectName;
                    $("#inputCompleted").value = a;
                    $("#inputTeamLead").value = i.teamLeadEID;
                    $("#inputQuarter").value = i.quarterName;
                    $("#inputStatus").value = i.statusName;
                    $("#inputDueDate").value = b;
                    $("#inputTraining").value = i.trainingName;
                    $("#inputStarted").val(c);
                });
               
            });
           
            $("#editModal").modal("show");
            }
    });


And this is my cshtml:

HTML
<pre><input asp-for="@Model.DateStarted" data-provide="datepicker" class="form-control" id="inputStarted" placeholder="Date Started">


What I have tried:

i tried using .val and value =
but still not working and even hard coded value to dev tools still not displaying date

my alert message displaying date in format of = "05/02/2021"


any help is appreciated
Posted
Updated 5-Feb-21 23:47pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900