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: Thu, 23 Aug 2007 09:15:35 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Mike
          2    RSH


delete text in a textbox   
Is there a way to determine if a user deleted text in a asp:textbox?

I have a textbox were users can enter in a product number, then they click a button to see if the product numbers(s) exists in our database, if they exist then the product name is returned and the product number is then replaced by the product name in the textbox.

The user can then, delete a product or all product names in the textbox and enter in new ones and click the button. When this happens the old product names in the textbox are still appearing even though the use deleted them.

Currently I'm storing the product ID and product name in a variable to keep adding products if need be and to pass them to my save function.

So is there a way to determine if the user deletes the text in the textbox, and if the text in the textbox matches my data in the variable?

Example: here is a few scenarios that can happen

1) a user enters in a product ID (dt1234) clicks enter - if t1234 exists in the database, the textbox then shows - Dumptruck 1/24
2) the user enters in product ID's (dt1234, t456,ft557) clicks add and if they exist the textbox shows (Dumptruck 1/24, trailer 1/24, Firetruck 1/24)
3) the user enters in product ID's (dt1234, t456,ft557) clicks enter, gets product name, Then the user deletes everything in the textbox and enters in new product ID's and clicks enter. In this case I only need to show the new products entered and not the old products and new products.


how can this be done?
I'm using a asp:textbox on the server, validating on the server
Date:Thu, 23 Aug 2007 09:15:35 -0400   Author:  

Re: delete text in a textbox   
mike,

i would say you could implement some javascript client side that would fire onchange in the appropriate textbox.  You could store the previous text in a variable and perform conditionals in the onchange event handler.  I use this type of procedure often, in some cases enabling and disabling ctontrols as well as clearing and repopulating controls as needed.  Powerful UI stuff for sure.

HTH,
Ron

  "Mike"  wrote in message news:etLNxeY5HHA.4164@TK2MSFTNGP04.phx.gbl...
  Is there a way to determine if a user deleted text in a asp:textbox?

  I have a textbox were users can enter in a product number, then they click a button to see if the product numbers(s) exists in our database, if they exist then the product name is returned and the product number is then replaced by the product name in the textbox.

  The user can then, delete a product or all product names in the textbox and enter in new ones and click the button. When this happens the old product names in the textbox are still appearing even though the use deleted them.

  Currently I'm storing the product ID and product name in a variable to keep adding products if need be and to pass them to my save function.

  So is there a way to determine if the user deletes the text in the textbox, and if the text in the textbox matches my data in the variable?

  Example: here is a few scenarios that can happen

  1) a user enters in a product ID (dt1234) clicks enter - if t1234 exists in the database, the textbox then shows - Dumptruck 1/24
  2) the user enters in product ID's (dt1234, t456,ft557) clicks add and if they exist the textbox shows (Dumptruck 1/24, trailer 1/24, Firetruck 1/24)
  3) the user enters in product ID's (dt1234, t456,ft557) clicks enter, gets product name, Then the user deletes everything in the textbox and enters in new product ID's and clicks enter. In this case I only need to show the new products entered and not the old products and new products.


  how can this be done?
  I'm using a asp:textbox on the server, validating on the server
Date:Thu, 23 Aug 2007 10:41:29 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


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