Hi all.
This all works on its own and i have no problem with this part, however this plugin seems to stop change events from firing on the original field when the moveNext() function is called.
For example, if I edit an input field value and then call moveNext() the focus is passed to the next field but the change event for the original field doesn't fire.
$.fn.moveNext = function(){
return this.moveIndex("next");
};
$.fn.movePrev = function(){
return this.moveIndex("prev");
};
$.fn.moveIndex = function(i){
// get the current position and elements
var aPos = getFieldPosition(this);
// if a string option has been specified, calculate the position
if( i == "next" ) i = aPos[0] + 1; // get the next item
else if( i == "prev" ) i = aPos[0] - 1; // get the previous item
// make sure the index position is within the bounds of the elements array
if( i < 0 ) i = aPos[1].length - 1;
else if( i >= aPos[1].length ) i = 0;
return $(aPos[1][i]).trigger("focus");
};
I want to know if its possible to modify this code so that i can trigger a blur event on the original field (ie 'this' in the code) and still return the focus to the next.
I think this will allow my change event to fire correctly.
This works as expected if you click between the two input fields but im trying to tab between the two input fields by calling the moveNext() function (see above).