Hi,
Try this example
<html>
<head>
<script type="text/javascript">
function demo(){
var amount=document.getElementById('amount').value;
var result=isValidAmount(amount);
if(result==true){
alert("Valid Amount");
}else{
alert("Invalid Amount");
}
}
function isValidAmount(amount){
var regEx=/^\d{1,13}.\d{2}$/;
if(amount.search(regEx)==-1){
return false;
}else{
return true;
}
}
</script>
</head>
<body>
<input type="text" id="amount" />
<input type="button" value="Test Validate" onclick="demo();"/>
</body>
</html>