I still can't reproduce your problem though I've found two other ways of getting the code to fail on my system.
1. If a letter key is rapidly alternated about a dozen times with the left arrow key.
2. If a long string is typed in which wraps onto the line below and then the backspace key is used to delete it.
Both problems disappear if read
is positioned at column 0. It seems read -e
does not work very well when used in the middle of a line.
Perhaps you should try changing your three line display into a six line display:-
It still won't be a foolproof way of entering text because if someone types in a very long name it will wrap onto the line below and overwrite the '2.Address :' prompt.
Using something like Xdialog, Zenity or Kdialog could give better results.
Xdialog has a --3inputsbox option for entering three fields of texts.