in the following function, as shown, the if does not retun with a true value and hence the .focus() does not execute.
But, if I remove the two slashes from the alert and let it execute, the subsequent if block now works.
The sdata array has a single value which is the same as the title input box.
Running on Fedora V13 with Firefox.
See below for more info!!
After writing this note, I did the following:
var target = document.getElementById('title').value;
var c = 0;
while (c < sdata.length)
//alert(target.toLowerCase() + "_" + sdata[c].toLowerCase());
if (target.toLowerCase() == sdata[c].toLowerCase())
I moved the alert to inside the If block and befor the .focus()
strangely I got the same results, so it seemed that the .focus was not working without some prior delay??!!
Then I moved it to just before the break, and this time there was NO focus observable in the window!! when I then pressed the tab key, focus appeared on the very first object (a radio button in this case).
Definitely seems like a timing conflict between where the focus wanted to go vs where it was directed to go!!!
Last edited by griffinmt; 11-26-2010 at 04:11 PM.
Reason: Further input
At least 98% of internet users' DNA is identical to that of chimpanzees
Thanks for that reference. I had done a search before but probably couldn't see the forest for the trees!!
Anyway, just by adding 'this' as a param for the onblur and adding a timeout in the function, problem is resolved!!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)