Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > something about RequiredValidator

Reply
Thread Tools

something about RequiredValidator

 
 
Kenny M.
Guest
Posts: n/a
 
      01-10-2005
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
 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      01-10-2005
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Down List control and RequiredValidator.InitialValue Shimon Sim ASP .Net 4 02-03-2006 06:23 AM
serverside RequiredValidator not working FireFox TJS ASP .Net 3 05-21-2005 06:00 PM
RequiredValidator not working tshad ASP .Net 7 05-21-2005 04:08 PM
Custom Validator not working without RequiredValidator Elie Medeiros via .NET 247 ASP .Net 1 05-18-2005 03:53 PM
requiredvalidator for checkbox SStory ASP .Net 3 07-30-2003 07:04 PM



Advertisments