I want to access the hidden field value in knockout.
Here is my html code
<td>
<input type="checkbox" data-bind="checked: status, disable: status, click: $root.UpdateStatus" />
<input id="hdnGoalId" type="hidden" data-bind="value: goalId" />
</td>
This is my javascript code
var WebmailViewModel = function() {
self.UpdateNote = function () {
$.ajax({
type: "POST",
url: 'SinglePageApp.aspx/UpdateNote',
data: "{goalId: '" + self.goalId + "'}",
contentType: "application/json; charset=utf-8",
success: function (result) {
alert(result.d);
}
});
};
};ko.applyBindings(new WebmailViewModel());
In UpdateNote i want to pass the selected goalId.
Please give me some advice.
Thanks for your response.I got the solution by updating like this
where tblUsers is the json object.