I use CompareValidator to validate user input on one of my forms, but for some reason it will not allow me to enter a dollar sign.
According to MSDN , the currency data type in the comparison validator allows you to:
A type of decimal data that can contain currency symbols.
I use the control below to verify:
<asp:CompareValidator ID="vld_Cash" runat="server" ControlToValidate="CashTextBox" Type="Currency" Operator="DataTypeCheck" ValidationGroup="vld_Update" ErrorMessage="The value entered for 'Cash' must be in a number format. Do NOT include dollar signs. Examples: 500 or 500.00" />
I also added the following to my web.config to be sure:
<globalization culture="en-US" uiCulture="en-US"/>
But he still says that any input with $ in it is invalid. Did I miss something?
source
share