function - jQuery and passing variables from decision structure -
i'm using jquery , i'm having issue passing variable function value of checkbox. can pass function switch statement, not if then. i'm looking assistance why.
$("input[type=checkbox]").change( function() { if($(this).is(":checked")){ passvar = ( $(this).val() ); addtoorder(passvar); alert(passvar); } else { alert("off"); } });
any assistance appreciated.
its working fine. see fiddle
$("input[type=checkbox]").change( function() { if($(this).is(":checked")){ passvar = ( $(this).val() ); alert(passvar); addtoorder(passvar); } else { alert("off"); } }); function addtoorder(t) { alert(t); tempstring = t.split(","); receipttext = receipttext + "<br>" + tempstring[0] + " - " + tempstring[1]; //alert(t); }
Comments
Post a Comment