DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 14 Aug 2007 10:11:53 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Tom
          2    Peter Bromberg [C# MVP]
          3    Tom


texbox data cleared - then clear variable   
I have a textbox on my web form were users can enter in 1 name or many names. The form then validates the name against the database.
If the name is valid its then saved into a varaible to be used at a later time. The issue I'm having is as follows:

the user enters in 2 names
John, Greg

clicks my valid button they're both valid so both names are stored in the variable so my variable looks like
John,Greg and both are in the textbox.

Now, the issue:
If the user clicks valid the variable gets populated, then the user decides to remove a name so it looks like this in the textbox
John

then they click valid, but the textbox still shows 
John, Greg even though Greg was removed

Is there a way to determine if a name was removed or if the textbox was cleared and the user entered in new names? 
such as this

first time entered:
John, Greg

user deletes both names and enters after the variable was populated
Stacey, Michelle

so when they click validate this time, I only want to see
Stacey, Michelle and not
John,Greg, Stacey,Michelle.

what is the best way to determine if the names changed after getting validated? 

I saw another question like this, and I tried the replies to that but no success, any other suggestions?
Date:Tue, 14 Aug 2007 10:11:53 -0400   Author:  

RE: texbox data cleared - then clear variable   
In the scenario that you have put yourself into here, you need to split the 
TextBox contents into a string array on the comma delimiter, iterate over 
every item in the array and check if it is already present in your storage 
object. And you have to check your storage items and make sure it doesn't 
still contain a name that the user has subsequently removed from the textbox. 
In sum, IMHO, you've got a real mess on your hands. Is there any reason why 
you can't come up with a more usable approach? 
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com



"Tom" wrote:


> I have a textbox on my web form were users can enter in 1 name or many names. The form then validates the name against the database.
> If the name is valid its then saved into a varaible to be used at a later time. The issue I'm having is as follows:
> 
> the user enters in 2 names
> John, Greg
> 
> clicks my valid button they're both valid so both names are stored in the variable so my variable looks like
> John,Greg and both are in the textbox.
> 
> Now, the issue:
> If the user clicks valid the variable gets populated, then the user decides to remove a name so it looks like this in the textbox
> John
> 
> then they click valid, but the textbox still shows 
> John, Greg even though Greg was removed
> 
> Is there a way to determine if a name was removed or if the textbox was cleared and the user entered in new names? 
> such as this
> 
> first time entered:
> John, Greg
> 
> user deletes both names and enters after the variable was populated
> Stacey, Michelle
> 
> so when they click validate this time, I only want to see
> Stacey, Michelle and not
> John,Greg, Stacey,Michelle.
> 
> what is the best way to determine if the names changed after getting validated? 
> 
> I saw another question like this, and I tried the replies to that but no success, any other suggestions?
Date:Tue, 14 Aug 2007 13:34:01 -0700   Author:  

Re: texbox data cleared - then clear variable   
I agree with you 100000%. I'm just coding to the requirements and even 
though I mentioned that its not really going to work correctly it doesn't 
matter.

Currently I have the textbox information coming through as a string array 
seperated by (;), I then take that and split it and take each name and 
validate the name. If valid, show in the textbox and store in my variable so 
I can keep adding valid names to it. If not valid, then its not added to the 
varaible and a message is shown to the user, (invalid user).

but the user can now, delete all the valid names in the textbox and start 
over and click the valid button again and go through the process again.

so i'm not finding a clear cut way to do this and have it work 100%. I've 
tried a ton of different scenarios and none are successfull.


"Peter Bromberg [C# MVP]"  wrote 
in message news:66780FAA-9B92-418C-8E27-FD9937778083@microsoft.com...

> In the scenario that you have put yourself into here, you need to split 
> the
> TextBox contents into a string array on the comma delimiter, iterate over
> every item in the array and check if it is already present in your storage
> object. And you have to check your storage items and make sure it doesn't
> still contain a name that the user has subsequently removed from the 
> textbox.
> In sum, IMHO, you've got a real mess on your hands. Is there any reason 
> why
> you can't come up with a more usable approach?
> -- Peter
> Recursion: see Recursion
> site:  http://www.eggheadcafe.com
> unBlog:  http://petesbloggerama.blogspot.com
> BlogMetaFinder:    http://www.blogmetafinder.com
>
>
>
> "Tom" wrote:
>
>> I have a textbox on my web form were users can enter in 1 name or many 
>> names. The form then validates the name against the database.
>> If the name is valid its then saved into a varaible to be used at a later 
>> time. The issue I'm having is as follows:
>>
>> the user enters in 2 names
>> John, Greg
>>
>> clicks my valid button they're both valid so both names are stored in the 
>> variable so my variable looks like
>> John,Greg and both are in the textbox.
>>
>> Now, the issue:
>> If the user clicks valid the variable gets populated, then the user 
>> decides to remove a name so it looks like this in the textbox
>> John
>>
>> then they click valid, but the textbox still shows
>> John, Greg even though Greg was removed
>>
>> Is there a way to determine if a name was removed or if the textbox was 
>> cleared and the user entered in new names?
>> such as this
>>
>> first time entered:
>> John, Greg
>>
>> user deletes both names and enters after the variable was populated
>> Stacey, Michelle
>>
>> so when they click validate this time, I only want to see
>> Stacey, Michelle and not
>> John,Greg, Stacey,Michelle.
>>
>> what is the best way to determine if the names changed after getting 
>> validated?
>>
>> I saw another question like this, and I tried the replies to that but no 
>> success, any other suggestions? 
Date:Wed, 15 Aug 2007 09:34:50 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us