XModPro

Validate - How Do We do a Numeric Compare (not String)?

Accuraty Accuraty asked Oct 4, 2013
Active Oct 16 · Viewed 2712 times
We have the following on a From:<br /><br />(using Brackets instead of &amp;lt; or &amp;gt;)<br /><br />[Validate Type=&quot;Compare&quot; Target=&quot;Subtotal&quot; Operator=&quot;LessThan&quot; CompareTarget=&quot;SpendingLimit&quot; CssClass=&quot;NormalRed ErrorMessage&quot;]Total is over the current spending limit!<br />[/Validate]<br /> <br />Both &quot;Subtotal&quot; and &quot;SpendingLimit&quot; are numbers (int32). But the Compare is treating them as strings, so with a SpendingLimit of 250 and a Subtotal of 1150, we do NOT get the expected results (Validation error).<br /> <br />Is there a way to force the Compare to work with the elements as numbers and not as strings?

1 Answer

Loading answers...