Ive tried few things and none of them works, it doesnt calculate the area, and i want to make user input to be positive number and send error if anything else is written
<!DOCTYPE html>
<html>
<head>
<title> Area of circle </title>
</head>
<body>
<script type="text/javascript">
<meta charset="UTF-8">
function CalculateArea(){
var r = document.form1.txtr.value;
var area = (r * r * Math.PI);
document.write("<P> Area is:" + area +"</P>")
}
</script>
<form name=form1>
Type radient of circle:
<input type="text" name="txtr" size=10>
<br>
<input type="button" value="Calculate" onClick='CalculateArea;'>
</form>
</body>
</html>