html - JQuery check box loop not working -


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) {                      }                 });              })         } 

i never see alert appear. if put on every line above is, appears, know it's problem loop of checked boxes i'm guessing. doing right? here div it's looping through:

<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 , date only)<br />                         <input type="checkbox" name="history">history<br />                     </div> 

thanks.

edit:

calling generatetermsheet() here:

$('#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");                 }             }         }); 

you try following selctor:

#termsheetpopup input[type="checkbox"]:checked 

maybe link support you: http://www.electrictoolbox.com/check-uncheck-checkbox-jquery/


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -