function createPCost() {
//alert() is to give an alert message, save the values as variables instead.

var hp = document.getElementById("hp1").value;
var r = document.getElementById("pr").value;

//do your calculations like u do in PHP
// answer = ((height (height / ratio) x .35 per sq inch)

var pc = ((hp*(hp/r)) * 0.30);
pc = Math.round(pc*100)/100;
var hpd = hp*1
var pw = (hp/r);
pw = Math.round(pw*1)/1;

       //set the value in the input field

document.getElementById("pc").value = pc;
document.getElementById("hpd").value = hpd;
document.getElementById("pw").value = pw;
}