> Thanks everyone for your suggestions. I was able to get this to work > by using with "the selStart" and "the selEnd". The additional trick > was to check in the on keydown behavior if the selEnd was equal to > the number of characters in the field. If so, I fiddled with the > string (inserted a hyphen if I needed) to, then set the selStart AND > the selEnd to the new end of the string. Works great!
Just to be a fly in your ointment, what about the following scenario - user enters a full zip (hyphen gets inserted), then selects and deletes the first 4 chars... first, does the hyphen adjust somehow, and second, will you get another hyphen when the user resumes typing? Users do the damndest things. Thought I'd point this possibility out in case it slipped by you (I hate that 5-hole). 2 hyphens, Kurt [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
