B
badstyle
newbie, learning some javascript...
started with this external script:
---------------------------------------------
var newNumber = document.form1.entry
function shout()
{
alert(newNumber + 5)
}
---------------------------------------------
within this html:
---------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="calculator-0001.js"></script>
</head>
<body>
<form name="form1" method="post" action="">
<input type="text" name="entry">
<input type="submit" name="addFive" value="+5" onClick="shout()">
</form>
</body>
</html>
---------------------------------------------
was hoping to get an alert with whatever number i put in the text with 5
added to it.
all i get is an alert with NaN.
Hopefully you can see where i'm going wrong??
...b..
started with this external script:
---------------------------------------------
var newNumber = document.form1.entry
function shout()
{
alert(newNumber + 5)
}
---------------------------------------------
within this html:
---------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="calculator-0001.js"></script>
</head>
<body>
<form name="form1" method="post" action="">
<input type="text" name="entry">
<input type="submit" name="addFive" value="+5" onClick="shout()">
</form>
</body>
</html>
---------------------------------------------
was hoping to get an alert with whatever number i put in the text with 5
added to it.
all i get is an alert with NaN.
Hopefully you can see where i'm going wrong??
...b..