usmankhan244
New Member
I want to access the hidden field value in knockout.
Here is my html code\[code\]<td> <input type="checkbox" data-bind="checked: status, disable: status, click: $root.UpdateStatus" /> <input id="hdnGoalId" type="hidden" data-bind="value: goalId" /> </td>\[/code\]This is my javascript code\[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());\[/code\]In UpdateNote i want to pass the selected goalId.Please give me some advice.
Here is my html code\[code\]<td> <input type="checkbox" data-bind="checked: status, disable: status, click: $root.UpdateStatus" /> <input id="hdnGoalId" type="hidden" data-bind="value: goalId" /> </td>\[/code\]This is my javascript code\[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());\[/code\]In UpdateNote i want to pass the selected goalId.Please give me some advice.