Here's a javascript function you can use
<script>
function checkDec(el){
var ex = /^[0-9]+\.?[0-9]*$/;
if(ex.test(el.value)==false){
alert('Incorrect Number');
}
}
</script>
To use it, call it in the onblur event
Eg: in html
<input type="text" önblur="checkDec(this);" />
Eg : in Asp.Net
<asp:TextBox onblur="checkDec(this);" ...
Note : i've made the decimal number entry optional here. If you want to make it compulsory, just take of the '?' in the line beginning with var ex =
Also the first character cannot be decimal here (for safety). Must enter 0.xxx instead of beginning with a .
(put the <spript></script> block in the <head> section)