You are using
$("hidden[name='ProductID']")[count].value();
It's wrong, to select an element using it's name you may use something like this:
$("input[name='ProductID']")
To get the value just use
var valueOfProductId = $("input[name='ProductID']").val();
Update: The ProductID
is used as id
in the rendered HTML
so try this to select it using id
:
var valueOfProductId = $('#ProductID').val();