Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox Validating Pet Peeve
Message
De
08/02/2006 11:28:12
 
 
À
08/02/2006 09:45:45
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01094630
Message ID:
01094666
Vues:
15
This message has been marked as the solution to the initial question of the thread.
Set the CausesValidation property on the button to false.

>I have one pet peeve with the Textbox Validating Event and wanted to see if anybody knew a work around.
>
>I have a textbox where the validating event forces the user to enter a positive number. If they do not, it opens a messagebox telling them to enter a positive number, sets the focus back to the textbox, and selects the text.
>
>Now say somebody enters a negative number, get the message box, and decides that they need to check on the value and in the meantime will do something else in the app. However, when they click the Cancel button on the form the validation event still fires, and they need to enter a valid value before they can cancel.
>
>Wouldn't it make sense for Validating event to not function if the user clicks the CancelButton of the form?
>
>I usually use custom validating that functions when a user tries to click on OK button for example, but in this one instance the Validating event would work better.
>
>Thanks.
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform