Input with value:
<input type="text" id="quantity" value="1" size="2"/>
ActionLink replaced with Url.Action:
<a href="@Url.Action("AddToCart", "Shop", new {parts_id=@Model.Parts.parts_id, quantity = "xxx"})" id="lnk">To cart</a>
and JS where I'm trying to replace the value:
<script>
$("#lnk").click(function (evt) {
var fakeUri = $("#lnk").prop("href");
var uri = fakeUri.replaceWith("xxx", $("#quantity").val());
uri = $("#lnk").prop("href", uri);
});
</script>
I think problem is in JS, the value is not replacing, client side sends "xxx"