Forum Moderators: open

Message Too Old, No Replies

Limit decimal places in input box?

         

dchaseworld

9:24 pm on Apr 14, 2005 (gmt 0)



Is there a way to limit the number of decimal places a user can add to a value in an input box? I need to limit users to 6 decimal places.

Thanks in advance!

tedster

10:30 pm on Apr 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello dchaseworld, welcome to the forums.

There's no way to this directly in the HTML. But you can run a validation script to enforce specific rules of many kinds - javascript onSubmit for the client-side, and your script of choice on the server side. If the integrity of the data is important, you can't just depend on the client side.