Foros de discusión

Trying to remove an empty <form> inside the <body>. AA+ accesib

thumbnail
Luis Rodríguez Fernández, modificado hace 13 años.

Trying to remove an empty <form> inside the <body>. AA+ accesib

Junior Member Mensajes: 86 Fecha de incorporación: 26/06/09 Mensajes recientes
Hi everyone!

We are trying to delete an empty form that we are finding inside the body of our pages:

<form name="hrefFm" method="post" id="hrefFm" action=""></form>


  • What is generating this piece of code?


  • How could we delete it?


We are trying to reach the AA+ accesibility, so delete this is mandatory for us.

Thank's in advance,

Luis
Mirosław Dąbrowski, modificado hace 12 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

New Member Mensajes: 2 Fecha de incorporación: 1/06/11 Mensajes recientes
Hi,

i managed to track this form filed. It comes from portlet_jsp.java class. html/portal/layout/view
Here you can find googled liferay src files from 6.0.26 build:

http://96.53.80.166/liferay/tomcat-6.0.26/work/Catalina/localhost/_/org/apache/jsp/html/portal/layout/view/

on line 926 you can see action parameter with no value, which causes W3C validation issues. Sadly it's hardcoded emoticon

out.write("<form action=\"\" id=\"hrefFm\" method=\"post\" name=\"hrefFm\"></form>");
thumbnail
Achmed Tyrannus Albab, modificado hace 9 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

Regular Member Mensajes: 158 Fecha de incorporación: 5/03/10 Mensajes recientes
2015 Liferay 6.2 GA3 and the darn thing is still there.
Anyone knows what is it for? Or is it even right to have it this way?
Thanks.
thumbnail
David H Nebinger, modificado hace 9 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Guys, this is not a problem except for braindead scanning tools.

The hrefFm form is inserted into the page but managed entirely by javascript. It is used by the DockBar, by Liferay ui taglibs, by Liferay portlettext taglibs, as well as by many of the Liferay standard portlets.

Sure it will look invalid but, when the javascript routines are applied against it, the URL is populated dynamically when the form is submitted. It has no body so it has no presentation on the page, but it is used a lot in the portal.
thumbnail
Achmed Tyrannus Albab, modificado hace 9 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

Regular Member Mensajes: 158 Fecha de incorporación: 5/03/10 Mensajes recientes
Thanks for the explanation.
thumbnail
Peter J Shields, modificado hace 8 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

Junior Member Mensajes: 26 Fecha de incorporación: 30/06/09 Mensajes recientes
Hi David,
I'm working on a custom 6.2 theme where there are no portlet borders or padding. Each page section docks directly with the next. This is a typical feature of modern web sites. I've also discovered this form and would like to modify it to set it's display attribute to none. Right now, it's showing up as an errant 22px space between the last portlet and the footer.

I understand it's needed and I'm good with that, BUT it doesn't need to be visible to work with JavaScript. Do you know where the source for this hard-coded form is located? I just need to give it a little touch to hide it.
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Can't you just define a rule for form#hrefFm?
thumbnail
Gurumurthy Godlaveeti, modificado hace 8 años.

RE: Trying to remove an empty <form> inside the <body>. AA+ accesib

Regular Member Mensajes: 208 Fecha de incorporación: 12/08/11 Mensajes recientes
Hi Peter,

For this, you don't need to know where it is hard coded. Its easy to do with CSS level only.

form#hrefFm{
display:none; // add this property if you want to hide it & not even interested to show space
visibility: hidden; // add this property if you want to hide it & space must be occupied by form in browser
}

That's all...

Let me know if i am wrong on your requirement.

Thanks
Guru