Last post Sep 13, 2011 04:28 PM by atconway
Sep 12, 2011 04:27 PM|j1234sai|LINK
Can I validate a texbox to have only True or false ? You should enter True or false in the textbox. Can we do that? Any help is appreciated.
Sep 12, 2011 04:50 PM|rossmc1|LINK
validate for regex
make that regex case insenstive
Sep 12, 2011 04:52 PM|mreyeros|LINK
Why not use a different user control, like a radiobutton list or a dropdown list that way you can restrict the values to either true or false and the user can only select one?
Sep 13, 2011 04:28 PM|atconway|LINK
Control + RegEx, AJAX Validator, or server side code. For example here is the server side code in a button click event or whatever postback method you are using:
If Me.TextBox1.Text.ToLower <> "true" Or Me.TextBox1.Text.ToLower <> "false" Then
Me.ErrorMessage.Text = "You must only enter 'true' or 'false'"