public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Leo-Andres Hofmann <hofmann@leo-andres.de>
To: development@lists.ipfire.org
Subject: [PATCH 2/4] zoneconf.cgi: Make output HTML 5 standard compliant
Date: Tue, 17 Nov 2020 07:29:02 +0100	[thread overview]
Message-ID: <20201117062904.1547-2-hofmann@leo-andres.de> (raw)
In-Reply-To: <20201117062904.1547-1-hofmann@leo-andres.de>

[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]

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(a)leo-andres.de>
---
 html/cgi-bin/zoneconf.cgi | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi
index 067410582..2346aa829 100644
--- a/html/cgi-bin/zoneconf.cgi
+++ b/html/cgi-bin/zoneconf.cgi
@@ -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
 ;
-- 
2.27.0.windows.1


  reply	other threads:[~2020-11-17  6:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17  6:29 [PATCH 1/4] zoneconf.cgi: Clean up HTML output Leo-Andres Hofmann
2020-11-17  6:29 ` Leo-Andres Hofmann [this message]
2020-11-17  6:29 ` [PATCH 3/4] zoneconf.cgi: Improve CSS Leo-Andres Hofmann
2020-11-17  6:29 ` [PATCH 4/4] zoneconf.cgi: Add NIC selection highlighting Leo-Andres Hofmann
2020-11-17 10:54 ` [PATCH 1/4] zoneconf.cgi: Clean up HTML output Michael Tremer
2020-12-01 22:25 ` Thank you for cleaning up the CGIs (was: Re: [PATCH 1/4] zoneconf.cgi: Clean up HTML output) Peter Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201117062904.1547-2-hofmann@leo-andres.de \
    --to=hofmann@leo-andres.de \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox