]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
zoneconf.cgi: Make output HTML 5 standard compliant
authorLeo-Andres Hofmann <hofmann@leo-andres.de>
Tue, 17 Nov 2020 06:29:02 +0000 (07:29 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Nov 2020 15:47:57 +0000 (15:47 +0000)
This fixes two minor violations of the HTML standard:
- <a> elements may not contain nested <button> elements:
Replace the button with a simple hyperlink, because it was only used as a link anyway.

- "id" attributes may not contain whitespace:
Remove unneeded attribute, use hyphens instead of spaces.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/zoneconf.cgi

index 0674105825fd6b1b7b52f5ba54ee684d3b12cd1a..2346aa829d9262faf27dae3faceaf528a7c138cc 100644 (file)
@@ -99,10 +99,6 @@ my $css = <<END
        #submit-container.input {
                margin-left: auto;
        }
-
-       button {
-               margin-top: 1em;
-       }
 </style>
 END
 ;
@@ -282,7 +278,7 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) {
        if ($VALIDATE_error) {
                &Header::openbox('100%', 'left', $Lang::tr{"error"});
 
-               print "$VALIDATE_error<br><a href='/cgi-bin/zoneconf.cgi'><button>$Lang::tr{'ok'}</button></a>";
+               print "$VALIDATE_error<br><br><a href='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'back'}</a>\n";
 
                &Header::closebox();
                &Header::closebigbox();
@@ -388,7 +384,7 @@ foreach (@nics) {
 
                                print <<END
                <td class="textcenter $slightlygrey">
-                       <input type="radio" id="PPPACCESS $mac" name="PPPACCESS" value="$mac" $checked>
+                       <input type="radio" name="PPPACCESS" value="$mac" $checked>
                </td>
 END
 ;
@@ -431,12 +427,12 @@ END
 
                print <<END
                <td class="textcenter $slightlygrey">
-                       <select name="ACCESS $uc $mac" onchange="document.getElementById('TAG $uc $mac').disabled = (this.value === 'VLAN' ? false : true)">
+                       <select name="ACCESS $uc $mac" onchange="document.getElementById('TAG-$uc-$mac').disabled = (this.value === 'VLAN' ? false : true)">
                                <option value="NONE" $access_selected{"NONE"}>- $Lang::tr{"zoneconf access none"} -</option>
                                <option value="NATIVE" $access_selected{"NATIVE"}>$Lang::tr{"zoneconf access native"}</option>
                                <option value="VLAN" $access_selected{"VLAN"} $vlan_disabled>$Lang::tr{"zoneconf access vlan"}</option>
                        </select>
-                       <input type="number" class="vlanid" id="TAG $uc $mac" name="TAG $uc $mac" min="1" max="4095" value="$zone_vlan_id" $field_disabled>
+                       <input type="number" class="vlanid" id="TAG-$uc-$mac" name="TAG $uc $mac" min="1" max="4095" value="$zone_vlan_id" $field_disabled>
                </td>
 END
 ;