function GenerateTermSheet()
{
var urlString = "<%= System.Web.VirtualPathUtility.ToAbsolute("~/mvc/Indications.cfc/RenderPartialTermSheetView/")%>"
$("#termSheetPopup checkbox:checked").each(function(){
alert("Clicked");
var json =
{
id : GetGUIDValue(),
name : $(this).attr("name")
}
$.ajax({
type: "POST",
url: urlString,
data: json,
success: function(data) {
}
});
})
}
我从来没有看到警报出现。如果我把它放在上面的每一行上,它就会出现,所以我知道这是我猜测的检查框循环的问题。我做对了吗?这里是它循环的div:JQuery复选框循环不起作用
<div id="termSheetPopup">
<div style="text-align:center;">
<select id="termSheetType">
<option>Internal</option>
<option>Borrower Facing</option>
</select>
</div>
<input type="checkbox" name="SummaryInformation">Summary Information<br />
<input type="checkbox" name="ProductLegs">Product Legs<br />
<input type="checkbox" name="AmortizationOptions">Amortization Options<br />
<input type="checkbox" name="Values">Values<br />
<input type="checkbox" name="Rates">Rates<br />
<input type="checkbox" name="RatesSpecific">Rates (All-In-Rate, PV01)<br />
<input type="checkbox" name="AmortizationSchedule">Amortization Schedule<br />
<input type="checkbox" name="SponsorInfo">Sponsor/Affiliate Info<br />
<input type="checkbox" name="BorrowerInfo">Borrower Info<br />
<input type="checkbox" name="SponsorContacts">Sponsor/Affiliate Contacts<br />
<input type="checkbox" name="CashFlows">Cash Flows<br />
<input type="checkbox" name="PrePayment">Pre-Payment<br />
<input type="checkbox" name="FutureExposure">Potential Future Exposure<br />
<input type="checkbox" name="FutureExposureSpecific">Potential Future Exposure (Max Number and Date Only)<br />
<input type="checkbox" name="History">History<br />
</div>
谢谢。
编辑:
调用GenerateTermSheet()位置:
$('#termSheetPopup').dialog({
modal: true,
resizable: false,
title: 'Generate Term Sheet',
width: 375,
height: 425,
autoOpen: false,
buttons: {
"Generate": function() {
GenerateTermSheet();
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
你在哪里调用`GenerateTermSheet()`? – Dutchie432 2011-02-10 21:40:18
已添加,但它的调用正确,因为我可以在设置urlString后发出警报并且它可以正常工作。 – slandau 2011-02-10 21:43:36
顺便说一下......即使在没有关闭标签的情况下工作,也不是不关闭它们的理由......总是关闭标签是一个好习惯。 – Mash 2011-02-10 21:48:21