On checking a field against validations, if validation fails , a pop up window is opened.Now when i close the pop up the pop up should return the focus to the last element(i
In your code, use:
MyPopUpWin(message); <- existing line inputs[i].focus()