function validateCollectPaymentInformationForm() { var method, name, number, expiry, errMsg errMsg = ""; method = document.getElementById('paymentMethod'); name = document.getElementById('txtCCName'); number = document.getElementById('txtCCNumber'); if (method.value == "" || method.value == "0" || method.value == null){ errMsg = "Please select a payment method \n"; } if (name.value == "" || name.value == null){ errMsg = errMsg + 'Please write down your name \n'; } if (number.value == "" || number.value == null){ errMsg = errMsg + 'Please provide credit card number \n'; }else if (number.value.length < 16 ){ errMsg = errMsg + 'Invalid credit card number \n'; } if (errMsg.length > 0 ){ alert(errMsg); method.focus(); return false; }else{ return true; } return false; } function validateCollectPaymentInformationForm() { var method, name, number, expiry, errMsg method = document.getElementById('paymentMethod'); name = document.getElementById('txtCCName'); number = document.getElementById('txtCCNumber'); if (method.value == "" || method.value == "0" || method.value == null){ alert('Please select a payment method'); method.focus(); return false; } if (name.value == "" || name.value == null){ alert('Please write down your name'); name.focus(); return false; } if (number.value == "" || number.value == null){ alert('Please provide credit card number'); number.focus(); return false; }else if (number.value.length < 16 ){ alert('Invalid card number'); number.focus(); return false; } return true; }
Aug 29