Using eval function to change comparison operator in a compare validator
Posted on 2013-06-17
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