Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to remove focus from form fields?
Hello 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.
Hi 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.
1) 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.
I can't reproduce on 7.4, will try on the latest 7.3
Interestingly, 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.
I 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.
Hang 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
Powered by Liferay™