diff --git a/app/Views/customer_form.php b/app/Views/customer_form.php index d5d2d0e6..2fa0886a 100644 --- a/app/Views/customer_form.php +++ b/app/Views/customer_form.php @@ -278,7 +278,7 @@
- @@ -463,6 +463,7 @@ html.find(".schange").html("- Remove "); html.insertAfter(".after-add-smore:last"); } + if (sarray.length == 1) { $(".schange").hide(); } j++; } } else { @@ -484,7 +485,12 @@ }); $("body").on("click", ".sremove", function() { - $(this).parents(".after-add-smore").remove(); + var rows = $(".after-add-smore"); + if (rows.length > 1) { + $(this).parents(".after-add-smore").remove(); + } else { + alert("At least one Shipping Address must be displayed."); + } toggleButtons(); });