Hello, Im writing a simple gas conversion tool that works in Internet explorer 7 but does not work in Firefox. Any help would be apperciated. Here is the code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function mcf2dth (form)
{
var vol = form.volume.value;
var btu = form.btu.value;
var answer = vol/btu;
answer = Math.floor(answer*1000+0.5)/1000;
if(isNaN(answer))
{
window.alert("Please enter numbers only")
document.myform.reset();
}
else
{
form.answer.value = answer + " Dth"
}
}
function dth2mcf (form)
{
var vol = form.volume.value;
var btu = form.btu.value;
var answer = vol*btu;
answer = Math.floor(answer*1000+0.5)/1000;
if(isNaN(answer))
{
window.alert("Please enter numbers only")
document.myform.reset();
}
else
{
form.answer.value = answer + " Mcf"
}
}
function mcf2ccf (form)
{
var vol = form.volume.value;
var btu = form.btu.value;
var answer = vol*btu;
answer = answer *10;
answer = Math.floor(answer*1000+0.5)/1000;
if(isNaN(answer))
{
window.alert("Please enter numbers only")
document.myform.reset();
}
else
{
form.answer.value = answer + " Ccf"
}
}
Thanks for your help, Im still new and I really apperciate your help.
I was using the maxlength = 0 in the conversion textbox so when people use the tool they cant type anything in so they dont get confused. Is there a way that I can set up that textbox in such a way that nothing can be typed into it and is just used to show the answer of the calculation?