0

I am having a jqGrid that contains two editable columns, start time and end time.

I have written a function call on the blur event of each of those columns for validation.

But the validation alert pop-up keeps popping up infinitely.

    `editOptions: {
         dataEvents: [{
         type: 'blur',
         fn: function (e) {
             if(startTime > endTime){
                 alert('Invalid');
                 return false;}
    }]}`

This editOptions is provided in both the column fields.

Note: A time picker is used in both the columns which also allows manual entry.

Jack
  • 1
  • 2
  • 1
    Just don't use alert() inside blur event. `alert()` is modal and get focus and on some browsers (safari?!) re-call blur event on event target. – A. Wolff Aug 31 '16 at 16:02
  • 1
    The blur event is sent to an element when it loses focus. Let us the focus is set on the input element of the first column. If you click on the input element of the second then the first element loses the focus. Because you use `alert` then the second element will loss the focus too (alert gets the focus). I don't see that you will get **infinite** calls of `blur` handler, but your current code don't allows to set focus on any from the two input elements. – Oleg Aug 31 '16 at 16:12

0 Answers0