Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event control problem

Status
Not open for further replies.

chateaucl

IS-IT--Management
Feb 5, 2001
9
CL
Can someone help me with this simple code, each time i try to run it i receive this error message: &quot;object expected&quot; at line 18, <INPUT TYPE=button.....> line

<html>
<head>
<title>Just testing.....</title>
</head>
<body>
<script language=&quot;JavaScript&quot;>
function clicked() {
form1.data=8;
}
}
</script>
<center>
<br><h1>Just Testing...</h1><br>
<form name=form1>
<input type=text name=data>
<br>
<br>
<input type=button name=&quot;Send&quot; value=&quot;Click&quot; onclick=&quot;clicked();&quot;>
<br>
</form>
</center>
</body>
</html>

thanks!
 
You are almost there :) Only some some wrong syntax

(one &quot;}&quot; to much)

This will work:

<script language=&quot;JavaScript&quot;>
function clicked() {
window.document.form1.data.value = '8';

}
</script>

Hope this helps you,

Erik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top