SerialCoder
Programmer
Hey all, after all these years of avoiding it, I have to learn some JavaScript. I'm getting frustrated because I can do any of this stuff with server side languages but I just cant seem to get the simplest of scripts to work... anyway, baby steps...
I have a test page that I want to write the length of the text input value to the page. It's just not doing it. any suggestions?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
<script language="JavaScript">
var myvar
myvar = "This is a test";
function thisfunction(thevalue)
{
myvar = myform.myval.value;
return myvar.length;
}
</script>
</head>
<body>
<form name="myform" method="POST">
<p><SCRIPT LANGUAGE="JavaScript">document.write(myvar.length)</script><br>
<input type="text" name="myval" size="20" value="test" onkeyup="thisfunction(this.value);"></p>
</form>
</body>
</html>
David Tulk
IS Manager - Dillin Engineered Systems
Conveyor Systems - Accumulation - Robotics - Systems Integration
I have a test page that I want to write the length of the text input value to the page. It's just not doing it. any suggestions?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
<script language="JavaScript">
var myvar
myvar = "This is a test";
function thisfunction(thevalue)
{
myvar = myform.myval.value;
return myvar.length;
}
</script>
</head>
<body>
<form name="myform" method="POST">
<p><SCRIPT LANGUAGE="JavaScript">document.write(myvar.length)</script><br>
<input type="text" name="myval" size="20" value="test" onkeyup="thisfunction(this.value);"></p>
</form>
</body>
</html>
David Tulk
IS Manager - Dillin Engineered Systems
Conveyor Systems - Accumulation - Robotics - Systems Integration