Confirmation function needs to stay checked....

Discussion in 'JavaScript' started by ajnin, Dec 30, 2008.

  1. #1
    Confirmation function needs to stay checked if a user hits teh back button or if the page has errors. I am using the following code:

      function confirmation() {
    			if (document.customer.b_offline.checked==true){
    				var answer = confirm("Please click \"OK\" if you would prefer to give your credit card number over the phone. Complete your order online then call 800-300-9993 to give us your credit card number. Click \"Cancel\" to complete your order in our guaranteed secure shopping cart.")
    				if (answer){
    					document.customer.cc_number.disabled = true;
    					document.customer.cc_type.disabled = true;
    					document.customer.fstore_payment.disabled = true;
    					document.customer.cc_month_expire.disabled = true;
    					document.customer.cc_year_expire.disabled = true;
    					document.customer.cc_scode.disabled = true;
    					document.customer.b_skip_cvv_1.disabled = true;
    					document.customer.b_skip_cvv_2.disabled = true;
    					document.customer.b_offline.checked = true;
    				}
    				else{
    					document.customer.cc_number.disabled = false;
    					document.customer.cc_type.disabled = false;
    					document.customer.fstore_payment.disabled = false;
    					document.customer.cc_month_expire.disabled = false;
    					document.customer.cc_year_expire.disabled = false;
    					document.customer.cc_scode.disabled = false;
    					document.customer.b_skip_cvv_1.disabled = false;
    					document.customer.b_skip_cvv_2.disabled = false;
    					document.customer.b_offline.checked = false;
    				}
    			}
    			else{
    				document.customer.cc_number.disabled = false;
    				document.customer.cc_type.disabled = false;
    				document.customer.fstore_payment.disabled = false;
    				document.customer.cc_month_expire.disabled = false;
    				document.customer.cc_year_expire.disabled = false;
    				document.customer.cc_scode.disabled = false;
    				document.customer.b_skip_cvv_1.disabled = false;
    				document.customer.b_skip_cvv_2.disabled = false;
    				document.customer.b_offline.checked = false;
    			}
            }
    
    Code (markup):
     
    ajnin, Dec 30, 2008 IP