<html>
<head>
<script type="text/javascript">
function fun()
{
var a = document.getElementById("costA").value
var b = document.getElementById("costB").value;
a=parseInt(a);
b=parseInt(b);
if (b<a)
{
alert("please give me the right cost range");
return false
}
}
</script>
</head>
<body>
<form>
<input type="text" name="A" id="costA">
<input type="text" name="B" id="costB" onChange="fun()">
</form>
</body>
</html>