Link to home
Start Free TrialLog in
Avatar of dond123
dond123Flag for United States of America

asked on

Using eval function to change comparison operator in a compare validator

I have a compare validator that compares the values of two text boxes:

This works the way I want if the user has selected  "fixedrate" from a dropdown:  
  <asp:CompareValidator ID="CompareValidator_walk_season1" runat="server"  ErrorMessage="LRA must be greater than NLRA" ControlToCompare="NLRA_season1"
          ControlToValidate="LRA_season1" Operator="GreaterThan" Type="Currency" Display = "Dynamic" CssClass = "ErrorMessage"></asp:CompareValidator>

However, if the user has selected "PercentOff' from that dropdown, I need everything the same,except the comparison operator needs to change to "less than"

Is is possble to use the eval function to change the comparison operator based on the value of the dropdown, and how would that code look, assuming drop down is ddlRateType

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial