Click here to Skip to main content
15,905,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,

How to validate against decimal value in java script?
user enter the values to textbox.

I Need accept my textbox only one Period(.) with decimal values
Example :
Come like,
12345.00,
21.00

But
Not Come
12.34.43,
1234.455.30
.00.00.34

only one time accept Period(.) operator when i validate in javascript

By mohan
Posted
Updated 9-Jan-12 21:59pm
v3

This Code will help you
JavaScript
var startVal = 123.456
alert((startVal - Math.floor(startVal)) != 0)

in the place of 123.456 put TextBox value
 
Share this answer
 
v2
Solution can be found here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900