Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Value of html Text column is not get updated from javascript , Please help

$
0
0

I have the following HTML

@model ModernTyres.GO.Common.Models.EmpDocumentModel<input type="text" name="Claim" class="form-control" id="TxtClaim" asp-for="Claim" data-role="text" disabled /><script>$(document).ready(function () {
    SetLicense();

}
  function SetLicense()
    {
    var url = '@Url.Action("GetLicense", "EmpDoc")';$.post(url, $('form').serialize(), function (view) {$("#TxtClaim").val(view.Claim);// The value TxtClaim should be updated from GetLicense. But not working 
        });


}
</script


public IActionResult GetLicense(EmpDocumentModel data)
        {
          EmpDocumentModel doc = new EmpDocumentModel();
          data.Claim = "TestClaim";  // This value should be updated in my html view
          return Json(data);

        }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>