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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Why not use onchange instead? On Jun 11, 11:18 am, few1938 <few1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Jun 11, 3:25 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why not use onchange instead? > > On Jun 11, 11:18 am, few1938 <few1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---