Using the “onmousemove” event

The “onmousemove” event can help you make sure that your script runs as well as your cursor on the form 🙂 I’ll give you a brief example of its usage. We want to trap the cursor’s coordinates as it moves in a certain entity’s form in CRM.

Add the following code on the OnLoad() event of a form you want:

document.onmousemove = function() {
window.status = event.clientX + “x”+event.clientY;
}

Of course, you may attach the “onmousemove” event to the crmForm too, using:

crmForm.onmousemove = function() {
window.status = event.clientX + “x”+event.clientY;
}


But this way, your status will update only if your cursor moves inside the crmForm, not in the entire window like in our first example.

2 comments

  1. Well, Microsoft Dynamics CRM is made for IE, not firefox, safari etc. That’s why I don’t complicate things 😉

Leave a Reply to Ciprian Cancel reply

Your email address will not be published. Required fields are marked *