XHTML Validation - Form NAME attribute

Help
2005-08-22
2013-04-25
  • Connor Murphy
    Connor Murphy
    2005-08-22

    Hello,

    Is there a way to use Struts so that Forms do not have to use the name attribute. The name attrinbute has been depreciated by the W3C and therefore fails validation.

    This is a major concern as I have a requirement that the site needs to be XHTML 1.0 Strict compliant.

    Any workarounds/ideas?

    Thanks,
    Connor

     
    • Matt Raible
      Matt Raible
      2005-08-22

      In my experience, XHTML 1.0 Transitional is just as good as Strict as it's still valid XML - just some different attributes that are allowed.

      Regardless, there is a way for you to do this. With Struts 1.2.7, you can add:

      <html:xhtml />

      to the top of your page, and the "name" attribute will go away.  Be aware that this will cause any "focus" or client-side javascript to fail.

      http://raibledesigns.com/page/rd?entry=failed_upgrade_to_struts_1

       
      • Don Brown
        Don Brown
        2005-08-22

        The workaround is to specify the styleId attribute of your form tag, then use the commons-validator fresh out of trunk.

        Don