1

I'm trying to pass the HTML validation (https://validator.w3.org/) of my code, but I've got the following problem:

there is no attribute "NAME"
<FORM name="formMenu" id="formMenu" action=...

I'm using JSF 1.2, and the tag that generates this part of code is the following:

<h:form id="formMenu" >
    ...
</h:form>

I've been reading about that error, and it seems that it's because you shouldn't use "name" in the form. The problem is that this one is rendered from the jsf h:form. Is there any way I can delete the "name" attribute?

TylerH
  • 20,799
  • 66
  • 75
  • 101
James
  • 95
  • 1
  • 9

1 Answers1

1

Is there any way I can delete the "name" attribute?

Yes, with a custom renderer.

Much better, however, is to fix your doctype to be HTML5 instead of HTML4 or XHTML strict. This attribute is allowed in HTML5 and as additional advantage, you're catching up current state of technology.

<!DOCTYPE html>

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thanks for the answer BalusC! I read it and it's very interesting! However, I tried to fix my doctype before but I got another error... No matters what Doctype I use in my code I always get an HTML with the following doctype: . I've read that this is due to some Mojarra's bugs... Do you know anything about that? – James Jun 30 '16 at 09:12
  • JSF 1.2 is way too long ago. I don't recall any JSF 1.2 specific bugs related to this. I can at most suggest to try upgrading to latest Mojarra 1.2 implementation, which is [1.2_15-03](http://central.maven.org/maven2/javax/faces/jsf-api/1.2_15-03) as of today. – BalusC Jun 30 '16 at 09:16