CRM 2011 – How to set focus using Javascript

I had a coding problem today, I was doing some validation in Javascript and then wanted to set the focus on the area.  You can also use this code on the page load if you want to set a default field to start with

var control = Xrm.Page.ui.controls.get(“AttributeName”);

control.setFocus();

Advertisements

4 thoughts on “CRM 2011 – How to set focus using Javascript

  1. hema October 29, 2012 / 10:16 am

    Was this sorted ??

    Like

  2. Hosk October 29, 2012 / 10:26 am

    was what sorted

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s