1function check_product(thisform, alert_added_to_basket){ 2 3 // Optional parameters 4 if(alert_added_to_basket == null){ 5 var alert_added_to_basket = true; 6 } 7 8 // Carries out standard onSubmit checks for product order forms 9 // To use include onSubmit="check_product(this)" 10 // in your form tag 11 12 var message = ""; 13 14 with (thisform){ 15 16 // Make sure we have selected a product 17 18 try { 19 if (order_prod_id.value <= 0){ 20 message = message + "\n\t"+"Please select a product"; 21 } 22 23 } catch (e) { 24 message = message + "\n\t"+"Please select a product"; 25 } 26 27 // Make sure any product options and user text are set 28 29 if (message != ""){ 30 alert("ERROR:\n"+message); 31 return false; 32 } else if(alert_added_to_basket == true) { 33 alert("Please note:\nYour selection has been added to your shopping basket.\n"); 34 return true; 35 } 36 } 37}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.