I dont understand why the following code is not working. I save some inputs values to sessions. In the next page, I want users be able to copy these values to input fields.
$(function() { $("input#copyshipping").click(function(){
if ($("input#copyshipping").is(':checked')) { // Checked, copy values $("input#BillingFirstName").val("<%=Session("ShippingFIRSTNAME")%>"); $("input#BillingLastName").val("<%=Session("ShippingLASTNAME")%>"); $("input#BillingAddress1").val("<%=Session("ShippingADDRESS1")%>"); $("input#BillingAddress2").val("<%=Session("ShippingADDRESS2")%>"); $("input#BillingCity").val("<%=Session("ShippingCITY")%>"); $("input#BillingState").val("<%=Session("ShippingSTATE")%>"); $("input#BillingCountry").val("<%=Session("ShippingPOSTALCODE")%>"); $("input#BillingPostalCode").val("<%=Session("ShippingCOUNTRY")%>"); } else { // Clear on uncheck $("input#BillingFirstName").val(""); $("input#BillingLastName").val(""); $("input#BillingAddress1").val(""); $("input#BillingAddress2").val(""); $("input#BillingCity").val(""); $("input#BillingState").val(""); $("input#BillingCountry").val(""); $("input#BillingPostalCode").val(""); } }); });