diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-02-02 02:15:36 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-02-02 02:15:36 +0000 |
commit | e521ef27e4fec28034ac816592b10cf9cc5cf2f2 (patch) | |
tree | f643e103fdc1abf8995cec1cdadf2792de5dd636 /usr/local/www/firewall_aliases_edit.php | |
parent | c565c45b4e136e102a950fa57f29ebd723c72378 (diff) | |
download | pfsense-e521ef27e4fec28034ac816592b10cf9cc5cf2f2.zip pfsense-e521ef27e4fec28034ac816592b10cf9cc5cf2f2.tar.gz |
Do not error out while adding and removing rows
Ticket #809
Diffstat (limited to 'usr/local/www/firewall_aliases_edit.php')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 3dad699..04edfc5 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -174,36 +174,42 @@ function typesel_change() { document.iform.address_subnet.disabled = 1; document.iform.address_subnet.value = ""; document.iform.address_subnet.selected = 0; - newrows = totalrows+1; + newrows = totalrows+100; for(i=2; i<newrows; i++) { - comd = 'document.iform.address_subnet' + i + '.disabled = 1;'; - eval(comd); - comd = 'document.iform.address_subnet' + i + '.value = "";'; - eval(comd); + var item = document.getElementById('document.iform.address_subnet' + i); + if(item) { + comd = 'document.iform.address_subnet' + i + '.disabled = 1;'; + eval(comd); + comd = 'document.iform.address_subnet' + i + '.value = "";'; + eval(comd); + } } break; case 1: /* network */ var cmd; document.iform.address_subnet.disabled = 0; -// document.iform.address_subnet.value = ""; - newrows = totalrows+1; + newrows = totalrows+100; for(i=2; i<newrows; i++) { - comd = 'document.iform.address_subnet' + i + '.disabled = 0;'; - eval(comd); -// comd = 'document.iform.address_subnet' + i + '.value = "32";'; -// eval(comd); + var item = document.getElementById('document.iform.address_subnet' + i); + if(item) { + comd = 'document.iform.address_subnet' + i + '.disabled = 0;'; + eval(comd); + } } break; case 2: /* port */ var cmd; document.iform.address_subnet.disabled = 1; document.iform.address_subnet.value = ""; - newrows = totalrows+1; + newrows = totalrows+100; for(i=2; i<newrows; i++) { - comd = 'document.iform.address_subnet' + i + '.disabled = 1;'; - eval(comd); - comd = 'document.iform.address_subnet' + i + '.value = "32";'; - eval(comd); + var item = document.getElementById('document.iform.address_subnet' + i); + if(item) { + comd = 'document.iform.address_subnet' + i + '.disabled = 1;'; + eval(comd); + comd = 'document.iform.address_subnet' + i + '.value = "32";'; + eval(comd); + } } break; } |