Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a text box validation variable
Message
De
08/08/2017 04:26:25
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
01653138
Message ID:
01653139
Vues:
53
>Hi,
>
>Say I have text box (asp:textbox) on a page which has a RequiredFieldValidator so that the text box cannot be left blank.
>
>And then I have a validation method that checks if the user entry is valid; that is, if DB has this entry in the table. If user enters wrong value, the page says "Invalid Entry - blablabla".
>
>But the user can still click on Submit button. And since the RequiredFieldValidator will not stop it (some "bad" entry is in the text box), the Submit click method will fire. I want to prevent it.
>
>So, when the code validation method check for a valid entry (in code behind) and find that the entry is not valid, I want to set a flag that will prevent Submit to fire.
>
>How do you do it?

One approach here : https://stackoverflow.com/questions/5929186/how-to-prevent-form-submission-while-using-html5-client-side-form-validation-in

I use angular. Easy to disable the button when a form is invalid - better than allowing a click and then rejecting it.....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform