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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Javascript error. Is Null or not an object error

Status
Not open for further replies.

calypso13

Technical User
Nov 5, 2004
21
0
0
US
Although the script works, I get this error
"textInput.Input is null or not an object."
Please help me. what am I doing wrong?

//input.htm
<html>
<title><title>
<head>
<script language="Javascript" type="text/javascript">
<!--
window.onload=DoThis;
function DoThis()
{
document.searchInput.search.focus();
if (searchInput.search.length != '0')
{
textInput.INPUT.focus();
}}
//-->
</script>
</head>

<body>
<FORM name="searchInput" action="input.htm" method="post" >
<INPUT maxLength=30 name="search">
<INPUT type="submit" value="search now" >
</FORM>
<form name="textInput" action="input.htm" method="post" >
<input type="text" maxlength="4" name="INPUT">
<input type="submit" value="Input">
</form
</body>
<html>
</code>
 
you should get into the habbit of using better references:

Code:
document.forms['textInput'].elements['INPUT'].focus();

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
I am still getting the same error. Only Happens in IE :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top