![]() |
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 |
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 06:51 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.