asp.net - textbox asp net validator for numerical, accept decimal -


i want make textbox contain numerical value, have accept decimal number

valid:

  • 1
  • 1.2
  • 1.23
  • 1.234
  • 0.0011 etc

but give error message if

  • 1,234
  • 1,23abc
  • 1.3454.21

this code far

<asp:textbox font-bold="true" id="textboxtaxvalue" runat="server" cssclass="textboxstring"                             width="80px"></asp:textbox><asp:label id="label24" runat="server" text="%"></asp:label>                         <ajaxtoolkit:filteredtextboxextender id="filteredtextboxextender1" runat="server"                             targetcontrolid="textboxtaxvalue" filtertype="custom, numbers" validchars="." />                         <asp:regularexpressionvalidator id="regularexpressionvalidator2" runat="server" errormessage="one '.' only!"                             controltovalidate="textboxtaxvalue" validationexpression="^(-)?\d+(\.\d\d)?$" /> 

please me

have try <asp:regularexpressionvalidator> &
validationexpression below
(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -