Write three JS Functions, and add them on page load like
<body onload="javascript:fnSaveHours();fnSaveRate();fnCalculatePay();">
</body>
In the first two functions, save the value in respective hidden variables in the page by capturing through prompt. In the last calculate the Pay based on two previously captured values.