We help IT Professionals succeed at work.

ASP.Net Textbox - way to store a value without showing?

sbornstein2 asked
Hello all,

I was wondering if I can somehow do this with a textbox.   User is going to select from a grid users so like name Doe, John; and I need to append to the textbox such as Doe, John; May, Sally; so there is a semi colon separator.   I need to store along with the selected name an ID.   I was hoping to be able to do this somehow in a textbox because I need it to be a line of names and trying to not use a listbox that I know would work.   The user also needs the ability to backspace and they should only be able to remove a whole name and not backspace through just some part of a selected name.  I want to store the selected value I have along with the name in the grid row to a string dictionary and if a name is removed remove it.  So for example:

Doe, John; May, Sally; Nobel, Chis;

then stored in a hidden string dictionary the value:
1234, 5678, 9102

Any way possible to do this with a textbox and have the user only be able to delete a whole name and then remove the value from the string dictionary?
Watch Question

you can use a "hidden" field

<input type="hidden" id="selectedID" text=""/>

as each name is selected, you can append (using JavaScript) to the selectedID field, with a ";" as a separator.

I am doing almost exactly this is an application that I am developing at my job.



glad to be of assistance.