input routine with backspace/delete, length restriction and cursor control