Could team consider this following rule?
- description of the Rule: form tag should not exist in the head tag. Some cybersecurity platforms such as Akamai will disable script in head tag. It leads abnormal result on screen.
- snippet of Noncompliant Code
<html>
<head>
...
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname">
</form>
...
</head>
<body>
...
</body>
</html>
- snippet of Compilant Code (fixing the above noncompliant code)
<html>
<head>
...
</head>
<body>
...
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname">
</form>
...
</body>
</html>
- exceptions to the Noncompliant Code: N/A
- external references and/or language specifications
HTML head Elements
The HTML<head>
element is a container for the following elements:<title>
,<style>
,<meta>
,<link>
,<script>
, and<base>
.
html - Is there a good reason that a form tag should not exist in the head tag? - Stack Overflow - type : Code Smell
Thanks,