Using onblur calling code below. In FF the cursor returns to the
element and immediately moves to the next input element. In IE the
cursor returns to the element and the onblur immediately fires cause a
loop between dialog window and element.
function chkminlen(obj,nlen) {
var objid = obj;
var objval = obj.value;
var cobj = objval.toString();
if (objval == '' && nlen > 0) {
alert("Value for this column is required!\n\nMinimum length is "
+nlen);
$(objid).activate(); return false;
}
if (cobj.length < nlen.toString()) {
alert("Minimum length for this column is " + nlen);
$(objid).activate(); return false;
}
}
I have tried .select() and .select().focus(). have also tried various
uses of the 'return', all cause similar problem.
Frank
on 2008-06-11 17:20
on 2008-06-12 15:58
The event is not at fault, the problem is focus on the input element is being set to the next input cell and not the one where the event occurred. The call '$(objid).activate(); return false;' should have returned focus to the proper element. I have changed the code somewhat, see http://www.pastebin.us/?show=m46cb9285 for the latest version of code. To any others out there, I ask that you take a look and please responde. Frank