The code is below. I have a user input a radius and it display a area of a circle. I need to make sure the user does not input negative or 0 radius. what should i add to make this work?
<html>
<head>
<title>Find the area and circumference of a circle</title>
</head>
<body>
<script language="JavaScript">
function CalculateArea(){
var radius =document.form1.txtRadius.value;
document.write("<P>The area of the circle is " + (radius * radius * Math.PI) + " </p>");
}
</script>
<form name=form1>
Enter the radius of circle:
<input type="text" name="txtRadius" size=10>
<br>
<input type="button" value="Calculate" onClick='CalculateArea();'>
</form>
</script>
</body>
</html>