dond123
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_sea son1"
ControlToValidate="LRA_sea son1" Operator="GreaterThan" Type="Currency" Display = "Dynamic" CssClass = "ErrorMessage"></asp:Compa reValidato r>
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!
This works the way I want if the user has selected "fixedrate" from a dropdown:
<asp:CompareValidator ID="CompareValidator_walk_
ControlToValidate="LRA_sea
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.