05 December 2007

How to setting focus to a Tab?

There are many discusses in CRM Forum, about how to setting focus to a Tab?
For example, I want the default tab1Tab to be the default tab when I open a record.

So if you put this code in onLoad() event:

document.getElementById('tab1Tab').focus();

It doesn't work as you expected.

But, if you use:

crmForm.all.tab1Tab.click();

It will work like a dream. :)

5 comments:

  1. Anonymous3:14 pm

    As you do to put the focus on the tab, i would like to put the focus on a field when the tab is selected.
    Any idea how to do it?

    ReplyDelete
  2. Anonymous1:55 pm

    Simple & beuatifull))

    ReplyDelete
  3. Anonymous2:05 pm

    Just doesn't work in CRM 4.0 ...

    ReplyDelete
  4. Anonymous9:46 am

    Thank you very much!!!

    Urix

    ReplyDelete
  5. Anonymous10:09 am

    Hello,
    I want to simulate adding a note manually using Javascript. I know the link name of "Click here to add a note", it's newNoteButton but I don't know how to execute this.

    document.getElementById('newNoteButton').click() doesn't work.

    Help me!!

    ReplyDelete