setting a focus event not working
Hi experts,
I am working in a third party application which has a hook into their window.onload() function.(it calls my fnCustomOnload()). In my fnCustomOnload() function I have tried to bind a focusout event on a particular input and have it call a function callled fnGetRestriction(). The function fnGetRestriction() actually works without errors, I have forced it with the grabfocus.focus() (lines 2 and 3) but it is called not being called any time other than once at the beginning when it is force by lines 2 and 3.. The line that performs the alert() (line 4) works properly all the time. What is wrong with line 5?
- function fnCustomOnload() {
- //var grabfocus = document.getElementById("WCCode");
- //grabfocus.focus();
- $('#WCCode').bind('focusout',function (){ alert("WCCode lost focus"); });
- //$('#WCCode').bind('focusout',fnGetRestriction());
- }
Thanks very much for your help.