You are saying that a single space character allows a RequiredFieldValidator
to accept the text? That is incorrect. The RequiredFieldValidator and all
other validators strip off lead and trailing spaces before evaluating text.
A single space would be eliminated and the field would be considered blank.
So if a single space is causing it to be accepted, something else is wrong.
Consider these issues:
1. Client-side validation isn't running or the submit button has
causesValidation=false. That means the page will submit without checking the
textbox.
2. On the server side, the submit button's OnClick method automatically
validates before calling your Click event. It will not do this when
CausesValidation is false. Users also forget to check for Page.IsValid in
the Click event method before saving data.
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"Srinivas" <no*****@email.com> wrote in message
news:ul**************@TK2MSFTNGP15.phx.gbl...
Hi
If a textbox is being validated using a required field validator then we
need to key in some text before sumbmitting the form. But if we key in a
space character this gets validated to true and the form gets submitted. I
want to make sure that the user enters some text and submit the form, and
not just enter a space character and submitting the form. Any ideas how to
achieve this.
Thanks,
Srinivas