Tuesday 8 March 2016

Set Focus using JavaScript in CRM

Hi,

Today I was working on validating some fields on the form and showing a message to the user to enter the data.

Normally whenever we do the validation, its always better to set the focus to the required field you are pointing out instead giving the pain to the user to search for it.

Here is the JavaScript code to set the focus to the field.

Xrm.Page.ui.controls.get("AttributeName").setFocus();

--
Happy CRM'ing

Gopinath

No comments:

Post a Comment