M
Mike
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
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