0
目前我有一個操作鏈接,將數據提交給一個操作。它還調用一個函數,它根據視圖上的數據填充一些JQuery參數。我想將這些JQuery值附加到操作鏈接,以便它們可以同時提交。如何附加JQuery以在Action Link上路由值?
查看:
<div class="AltFunctions">
<ul>
<li>
@Html.ActionLink("fd", "ExportClaimBySupplier", "Search", new {ClientID = Model.inputParameters[0], SupplierID = Model.inputParameters[1], JsonReviewPeriod = Json.Encode(Model.inputReviewPeriodIDs), GroupID = Model.inputParameters[2], AmountFrom = JQueryValue, AmountTo = JQueryValue, AllDDValues = JQueryValue}, new { @id = "altExportButton", @class = "AltButton", Title = " Export data to excel" })
</li>
<li>
<a href="#ClaimsBySupplierModal" data-target="#ClaimsBySupplierModal" data-toggle="modal" class="AltButton" id="altInfoButton" title="Information on the Supplier report">Info</a>
</li>
</ul>
</div>
JQuery的:
<script>
$('#altExportButton').on('click', function() {
var AmountFrom = $('#txtAmountFrom').val();
var AmountTo = $('#txtAmountTo').val();
var AllDDValues;
var count = 1;
$('.ExportValues').each(function() {
if (count == 1) {
AllDDValues = this.value;
count = 2;
}
else if(count == 2 && AllDDValues != "") {
AllDDValues = AllDDValues + ", " + this.value;
}
});
});
</script>
我需要AmountFrom,AmountTo和AllDDValues追加到操作鏈接。
謝謝!有效 –