Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
venka reddy
focusing form field - How it is working?
November 14, 2013 11:26 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi,

I need to focus the form field ,i.e by default when form is loaded i need to point my cursor the first field of textbox. so i have searched in google somehow i found it .

Find the below code, But I need to know how it is working at backend to highlight field? What are the scripts liferay is loading by default?

<aui:form>

<aui:input name="title" Label="Title"/>

</aui:form>

<aui:script>

Liferay.Util.focusFormField(document.<portlet:namespace/>fm.<portlet:namespace/>title);

</aui:script>
David H Nebinger
RE: focusing form field - How it is working?
November 14, 2013 11:30 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11262

Join Date: September 1, 2006

Recent Posts

it is not doing anything on the backend. It is totally running within the browser. back end has no concept of 'focus'.

Check out /html/js/liferay/util.js and search for "focusFormField" to find the implementation.