HTML/JavaScript: Submitting a textbox?

Jacherbid

New member
I know only JavaScript & HTML.

I am making a website that uses "var x=prompt" to get information. However, my Vista computer blocks the prompt. Is there a way I can change the prompt to a textbox to get information. I don't want to have to teach myself ASP or PHP, so is there a different way from <form action="whatever">?

Thanks!

PS My HTML looks like:

<html>
<head><title>Math</title>
<script type="text/javascript">
function stat()
{
{
alert("Please enter a number in character (ex. 1, not one) form")
}
var stat=prompt("What was that number?","0");
if (stat!=null)
{
document.write("<h2>Your number was " + stat + "</h2><br><br>" + stat + " squared is " + stat*stat + "<br>" + stat + "

cubed is " + stat*stat*stat + "<br>" + stat + "'s square root is " + Math.sqrt(stat) + "<br>Half of " + stat + " is " +

stat*0.5 + "<br> One " + stat + "th is " + 1/stat + "<br>" + stat + " feet is " + stat*12 + " inches (" + stat*12*2.54 + "

centimeters) <br>" + stat + "? is approx. " + stat*Math.PI);
}
}
</script>


<script type="text/javascript">
function square()
{
{
alert("Please enter a number in character (ex. 5, not five) form")
}
var name=prompt("What was that number?","1");
if (name!=null)
{
alert(name + " squared is " + name*name);
}

}
</script>

<script type="text/javascript">
function cube()
{
{
alert("Please enter a number in character (ex. 12, not twelve) form")
}
var name=prompt("What was that number?","3.78");
if (name!=null)
{
alert(name + " cubed is " + name*name*name);
}

}
</script>

<script type="text/javascript">
function sqrt()
{
{
alert("Please enter a number in character (ex. 8, not eight) form")
}
var name=prompt("What was that number?","2");
if (name!=null)
{
alert(name + "'s square root is " + Math.sqrt(name));
}

}
</script>
<style type="text/css">
body
{
background-color:#4A7023;
}
</style>
</head>
<body><font color="white">
<script type="text/javascript">
for (i = 1; i < 10; i++)
{
document.write(i + "'s square is " + i*i + ", and its cube is " + i*i*i);
document.write("<br />");
}
</script><br><br><br><br><br>


<input type=button value="Square-a-Number" onclick="square()">
<input type=button value="Cube-a-Number" onclick="cube()">
<input type=button value="Square-Root-a-Number" onclick="sqrt()"><br>
Or:
<input type=button value="Try this one" onclick="stat()"><br>

</font>
</body>
</html>
 
Back
Top