Message Boards
How to remove focus from form fields?
How to remove focus from form fields?
New Member Post: 1 Join Date: 12/16/21 Recent PostsHello everyone, I'm making a home page of a site that contains a form using the liferay dxp 7.3.10 form portlet. When I open the page, it automatically focuses on one of the form's fields, moving the page to it, but I don't want that behavior.
RE: How to remove focus from form fields?
Expert Posts: 291 Join Date: 2/13/13 Recent PostsHi Danilo, can you provide some detailed steps to reproduce this? Include things like the exact Liferay version and whether you're using a Widget Page or Content Page.
RE: RE: How to remove focus from form fields?
Expert Posts: 449 Join Date: 5/26/15 Recent Posts1) Create a form with two text inputs like Firstname Lastname
2) Add a widget page, with a lot of basic web content at the top of
the page
3) Add the form display widget
4) Select the form
created
5) Visit the widget page
Actual:
Page jumps down to form upon page load and flashes a
cursor sometimes in a random filed of the form.
Expected:
Focus remains at the top of the page upon page load
and user is not taken to the form on page load.
RE: RE: How to remove focus from form fields?
Expert Posts: 291 Join Date: 2/13/13 Recent PostsI can't reproduce on 7.4, will try on the latest 7.3
RE: RE: How to remove focus from form fields?
Expert Posts: 291 Join Date: 2/13/13 Recent PostsInterestingly, I cannot reproduce on 7.3 DXP SP3, but I can reproduce on 7.3 CE GA8. So I think you're probably stuck with the workaround for noe as I'm not aware of plans to release more 7.3 GAs.
RE: How to remove focus from form fields?
Expert Posts: 449 Join Date: 5/26/15 Recent PostsI have suffered the same fate. The only real way around it I found was to add a widget page with the form on it. Go to the configuration and sharing, get the iframe for the widget (keep that widget on that page). Go to the homepage and add a basic web content (in my case I have a web content template callled "HTML" so I can avoid basic web).
Embed the iframe for the form on the homepage and maybe set the hieght of the iframe to the height of the form.
That should isolate the form from the homepage and so the focus of the browser goes to the homepage not the form.
RE: How to remove focus from form fields?
Expert Posts: 449 Join Date: 5/26/15 Recent PostsHang in there, unfortunatly if we as the community report issues they often don;t get looked at.
However by chance this may have been discovered internally (even
though we got to it first)
https://issues.liferay.com/browse/LPS-152495