chuang4630
asked on
How to use the CompareValidator control?
I need to implement a text box control with following validation rules:
(1) It should not be blank
(2) It should NOT equal to the string "Please enter your name here"
For first condition, I use Required field validator, it works fine.
For second condition, I think about using CompareValidator. But I need assistance on
(1) How do you set the property of "control to compare"? It compares to itself, actually. Do we need to set it anyway?
(2) How to set the property "Value to compare"? I set it to be the string above. But how do you set condition evaluation to be TRUE or FALSE?
(1) It should not be blank
(2) It should NOT equal to the string "Please enter your name here"
For first condition, I use Required field validator, it works fine.
For second condition, I think about using CompareValidator. But I need assistance on
(1) How do you set the property of "control to compare"? It compares to itself, actually. Do we need to set it anyway?
(2) How to set the property "Value to compare"? I set it to be the string above. But how do you set condition evaluation to be TRUE or FALSE?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can set 'Initial Value' of your "Required validator" control to "Please enter your name here", you don't even need to use Compare Validator.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.