diff --git a/src/www/firewall_nat_edit.php b/src/www/firewall_nat_edit.php index 6031b5cf1..a865d236b 100644 --- a/src/www/firewall_nat_edit.php +++ b/src/www/firewall_nat_edit.php @@ -476,6 +476,19 @@ $( document ).ready(function() { $('#dstendport').prop('selectedIndex', $("#dstbeginport").prop('selectedIndex') ); $('#dstendport').selectpicker('refresh'); $('#dstendport').change(); + // on new entry, align redirect target port to dst target + if ($("#entryid").length == 0) { + $('#localbeginport').prop('selectedIndex', $("#dstbeginport").prop('selectedIndex') ); + $('#localbeginport').change(); + } + }); + + $("input[for='dstbeginport']").change(function(){ + // on new entry, align redirect target port to dst target + if ($("#entryid").length == 0) { + $("input[for='localbeginport']").val($(this).val()); + $("input[for='localbeginport']").change(); + } }); // IPv4/IPv6 select @@ -1079,7 +1092,7 @@ $( document ).ready(function() { " /> " onclick="window.location.href='/firewall_nat.php'" /> - +