Skip to content Skip to sidebar Skip to footer

How To Get The Value Of A Hiddenfor Control In Jquery

i have a hidden for control as @Html.HiddenFor(m => m.SchedulingProfileDetails.Id) I am trying to access the value in this hidden field in my jquery and then trying to pass th

Solution 1:

I could be wrong, but isn't it merely that:

var id = $("#SchedulingProfile_Id").val();

needs to be:

var id = $("#SchedulingProfileDetails_Id").val();

?

Solution 2:

I'ts always good to check the generated HTML page, simply search for hidden input.

Also you are trying to pass schedulingProfileId to your AJAX call, I think it should be:

$.ajax({
url: rootUrl + 'SchedulingProfile/SaveDetails',
type: "POST",
data: ({
    schedulingProfileId: id, 
       });

Post a Comment for "How To Get The Value Of A Hiddenfor Control In Jquery"