Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   something about RequiredValidator (http://www.velocityreviews.com/forums/t775174-something-about-requiredvalidator.html)

Kenny M. 01-10-2005 08:53 PM

something about RequiredValidator
 
I have a textBoxt associated to a RequiredFieldValidator and a Button

When the textbox is empty and I click the button the validator works fine,
but when the cursor is in the empty TextBoxt and I press Enter a PostBack is
fired.

Why the validator does not validate the empty TextBox in this case, and what
should I do?


--
Ken

Steve C. Orr [MVP, MCSD] 01-10-2005 10:11 PM

Re: something about RequiredValidator
 
I agree that it's annoying that when a user presses the enter key, it
doesn't always register as a button click event. Luckily you can fix this
shortcoming.

You could use this free control to solve the problem.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here are a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"Kenny M." <KennyM@discussions.microsoft.com> wrote in message
news:AB7E0F8B-14CF-4C4D-BFD4-BF41F54ED8A8@microsoft.com...
>I have a textBoxt associated to a RequiredFieldValidator and a Button
>
> When the textbox is empty and I click the button the validator works fine,
> but when the cursor is in the empty TextBoxt and I press Enter a PostBack
> is
> fired.
>
> Why the validator does not validate the empty TextBox in this case, and
> what
> should I do?
>
>
> --
> Ken





All times are GMT. The time now is 02:22 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.