HTML5: Input box with regular expressions


/ Published in: HTML
Save to your folder(s)

If I ever need a regular expression for $99.99. Here it is.


Copy this code and paste it in your HTML
  1. <input type="text" pattern="^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$" name="widgetprice" id="widgetprice" size="25" value="<%= widget.price %>" required/>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.