# Add dollar Sign ($) to textbox constraint. asked 2016-05-17 18:22:43 +0800 Princenuk 29 5 I am currently using this textbox constraint to allow 6 figure numbers with up to 3 decimal places. <textbox id="bal" maxlength="11" constraint="/^[0-9]{1,6}(?:[.][0-9]{1,3})?$/"/>


So I can enter up to 999999.999. However, I want to allow for a $sign to be entered before the number. How do I add that to the constraint? delete retag edit ## 1 Answer Sort by » oldest newest most voted answered 2016-05-18 09:39:34 +0800 IngoB 256 6 How about this? It is optional to enter a dollar sign in front: ^\$?[0-9]{1,6}(?:[.][0-9]{1,3})?\$

if it should always be in front, just remove the "?"

Thanks, Just what I needed.

( 2016-05-18 14:54:06 +0800 )edit
[hide preview]