<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
li {list-style-type: none;  
font-size: 16pt;  
}  
.mail {  
margin: auto;  
padding-top: 10px;  
padding-bottom: 10px;  
width: 400px;  
background : #D8F1F8;  
border: 1px soild silver;  
}  
.mail h2 {  
margin-left: 38px;  
}  
input {  
font-size: 20pt;  
}  
input:focus, textarea:focus{  
background-color: lightyellow;  
}  
input submit {  
font-size: 12pt;  
}  
.rq {  
color: #FF0000;  
font-size: 10pt;  
}  
</style>
</head>

<body>
<body onload='document.form1.text1.focus()'>  
<div class="mail">  
<h2>Check whether the field input contains a number with no exponent, mandatory integer and fraction and optional sign</h2>  
<form name="form1" action="#">  
<ul>  
<li><input type='text' name='text1'/></li><br><li>&nbsp;</li>  
<li><input type="submit" name="submit" value="Submit" onclick="CheckDecimal(document.form1.text1)"/></li>  
<li>&nbsp;</li>  
</ul>  
</form>  
</div>  
echo str_replace("world","Peter","Hello world!");
</body>
</html>

<script>
$('.text1').keypress(function(event) {
  if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
    event.preventDefault();
  }
});


/*function CheckDecimal(inputtxt)   
{   
var decimal=  /^[-+]?[0-9]+\.[0-9]+$/;   
if(inputtxt.value.match(decimal))   
{   
alert('Correct, try another...')  
return true;  
}  
else  
{   
alert('Wrong...!')  
return false;  
}  
}   */
</script>  

