From c813ea5eecfcc85e57b692107378a4e7e228e046 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Tue, 27 Jan 2015 22:08:02 +0000 Subject: [PATCH] If Patron isn't logged in but sold_to will validate correctly. --- js/transaction.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/js/transaction.js b/js/transaction.js index 514db61..37b155c 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -484,17 +484,18 @@ $(function() { var err1 = 0, err2 = 0, err3 = 0, err4 = 0, err5 = 0, err6 = 0, err7 = 0, err8 = 0; // sold_to error - if ( !$("#anonymous").prop("checked") ) { - err1 = error_handler(sold_to.val(), sold_to_error, "no_selection", "*Required   ",e); - } else if ( $("#anonymous").prop("checked") ) { - sold_to_error.hide(); - } + if ( !$("[name='sold_to']").is("span") ) { // Patron already performed transaction and isn't logged in + if ( !$("#anonymous").prop("checked") ) { + err1 = error_handler(sold_to.val(), sold_to_error, "no_selection", "*Required   ",e); + } else if ( $("#anonymous").prop("checked") ) { + sold_to_error.hide(); + } + } // sold_by error err2 = error_handler(sold_by.val(), sold_by_error, "no_selection", "*Required",e); - // for storage transactions don't check for payment_type and payment until there is an actual date - console.log("Date: " + date.val()); + // for storage transactions don't check for payment_type and payment until there is an actual date var payment_type_result; if ( date.val() != "0000-00-00" && date.val() != "") {