We help IT Professionals succeed at work.

ASP.Net Textbox Format Question

sbornstein2
sbornstein2 asked
on
Hello all,

I have a textbox where a user clicks from a grid and it appends to the textbox a persons name and semilcolon such as:

Doe, John;  McFalley Sally; Dole Bob;

If the user wants to delete a name from the textbox, I want it to act similar to outlook etc. where as they back space starting at the semilcolon it deletes that entry in whole.   Any idea how to do that on key press etc?
Comment
Watch Question

Commented:
Use javascript.
On textbox focus capture keypress
if keypress == backspace
convert textbox.value to array using string.split
remove last element from aray
put all array elements back into textbox.value

http://ne0phyte.com/blog/2008/09/02/javascript-keypress-event/
May help, look in comments for "backspace" hint.

Author

Commented:
thanks