Hi I’m really new at javascript and need some help. When i view the following code in Netscapes javascript console, I get an error that says
the text area I want to print to is not defined but i gave the text area a name. Don’t know what’s wrong so if someone could help me out, I would greatly appreciate it. Here’s the code:
[COLOR=coral]
<html xmlns=”
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<script language=”javascript”>
function myFunct(form1,texta){
var word=form1.enstring.value;
}
form2.texta.value=word;
</script>
</head>
<body align=”center”>
<form name = “form1”>
<div align=”center”>
<input name=”enstring” type=”text” value=”” size=”100″>
<input type=”button” value=”Run Program”
name=”start” onclick=”myFunct(document.form1,document.form2.texta);”>
</div>
</form>
<form name=”form2″>
<p align=”center”><textarea rows=”17″ name=”texta” cols=”38″></textarea></p>
</form>
</body>
</html>
Thanks.