Guys, Anyone has a javascript code wherein it allows the textbox to enter only decima(12,2). So in short his only allowed to enter numeric and dot with a maximum length of billion 999999999999.99 and 99999999999999 (15 integers) is not allowed Thanks, Mike
I think this will work for you, only thing I wasn't too sure about is the decimal. In this regex there has to be a decimal and at least 1 number eg. 100 is "false" but 100.0 is "true" ... <html> <head> <script language="javascript"> function checkval(mynum) { var re = /[0-9]{1,12}\.[0-9]{1,2}/.test(mynum); alert(re); // if re is false then etc etc } </script> </head> <body> <input onblur="checkval(this.value);"></input> </body> </html> Code (markup):