I need to add an @Html.HiddenFor when a button is clicked
My jquery code is this:
function btnAdd() {
var x;
y = $("#drpDwnPRTPP");
$("#budgetsList ul").html('<li>Primer elemento ' +
'@Html.HiddenFor(x => Model.ToList()['+ c +'].PRTPP_ID, new { @id="prtppID"'+ c +', @value="'+ y.val() +'" })' +
'</li>'
);
}
But when i clicked this is what i get in my html :
Primer elemento @Html.HiddenFor(x => Model.ToList()[0].PRTPP_ID, new { @id="prtppID"0, @value="1" })
instead an input element
any way to do this ? ? ...