Fix #3103, cleanup ports fields when protocol changes

This commit is contained in:
Renato Botelho 2013-07-24 16:23:06 -03:00
parent 140ed85e94
commit 7fa503d8f2
2 changed files with 9 additions and 3 deletions

View File

@ -718,7 +718,7 @@ include("fbegin.inc"); ?>
<tr>
<td><?=gettext("from:"); ?>&nbsp;&nbsp;</td>
<td>
<select name="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()">
<select name="dstbeginport" id="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()">
<option value="">(<?=gettext("other"); ?>)</option>
<?php $bfound = 0;
foreach ($wkports as $wkport => $wkportdesc): ?>
@ -731,7 +731,7 @@ include("fbegin.inc"); ?>
<tr>
<td><?=gettext("to:"); ?></td>
<td>
<select name="dstendport" class="formselect" onchange="ext_change()">
<select name="dstendport" id="dstendport" class="formselect" onchange="ext_change()">
<option value="">(<?=gettext("other"); ?>)</option>
<?php $bfound = 0;
foreach ($wkports as $wkport => $wkportdesc): ?>
@ -761,7 +761,7 @@ include("fbegin.inc"); ?>
<tr name="lprtr" id="lprtr">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Redirect target port"); ?></td>
<td width="78%" class="vtable">
<select name="localbeginport" class="formselect" onchange="ext_change();check_for_aliases();">
<select name="localbeginport" id="localbeginport" class="formselect" onchange="ext_change();check_for_aliases();">
<option value="">(<?=gettext("other"); ?>)</option>
<?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?>
<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['localbeginport']) {

View File

@ -138,6 +138,12 @@ function proto_change() {
document.getElementById("sprtable").style.display = 'none';
document.getElementById("dprtr").style.display = 'none';
document.getElementById("lprtr").style.display = 'none';
document.getElementById("dstbeginport").selectedIndex = 0;
document.getElementById("dstbeginport_cust").value = "";
document.getElementById("dstendport").selectedIndex = 0;
document.getElementById("dstendport_cust").value = "";
document.getElementById("localbeginport").selectedIndex = 0;
document.getElementById("localbeginport_cust").value = "";
}
}